All Projects → yanhaijing → Template.js

yanhaijing / Template.js

Licence: mit
A javascript template engine, simple, easy & extras, support webpack, rollup, parcel, browserify, fis and gulp

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Template.js

Babel Plugin Prismjs
A babel plugin to use PrismJS with standard bundlers.
Stars: ✭ 114 (-90.51%)
Mutual labels:  webpack, rollup, browserify
Seed Quickstart Webpack
Template for web apps with Seed (Rust framework), TailwindCSS and Webpack.
Stars: ✭ 73 (-93.92%)
Mutual labels:  webpack, template, handlebars
Harold
Compares frontend project bundles
Stars: ✭ 241 (-79.93%)
Mutual labels:  webpack, rollup, parcel
Webpack Seed
🚀 A Multi-Page Application base on webpack and babel. webpack搭建基于ES6,支持模板的多页面项目
Stars: ✭ 113 (-90.59%)
Mutual labels:  webpack, handlebars, ejs
Vue Plugin Template
🚀 Solid foundation to start a Vue plugin with the best developer experience and a focus on performance
Stars: ✭ 189 (-84.26%)
Mutual labels:  webpack, rollup, template
Modular Css
A streamlined reinterpretation of CSS Modules via CLI, API, Browserify, Rollup, Webpack, or PostCSS
Stars: ✭ 234 (-80.52%)
Mutual labels:  webpack, rollup, browserify
layouts
Wraps templates with layouts. Layouts can use other layouts and be nested to any depth. This can be used 100% standalone to wrap any kind of file with banners, headers or footer content. Use for markdown, HTML, handlebars views, lo-dash templates, etc. Layouts can also be vinyl files.
Stars: ✭ 28 (-97.67%)
Mutual labels:  handlebars, jade, ejs
Public
Repository for wallaby.js questions and issues
Stars: ✭ 662 (-44.88%)
Mutual labels:  webpack, browserify
Jslib Base
A modern JavaScript|Typescript library scaffolding, modularity, purity & extras
Stars: ✭ 721 (-39.97%)
Mutual labels:  rollup, template
Uicookbook
A few recipes and build workflows for UI dev
Stars: ✭ 19 (-98.42%)
Mutual labels:  webpack, browserify
Suicrux
🚀 Ultimate universal starter with lazy-loading, SSR and i18n. [not maintained]
Stars: ✭ 958 (-20.23%)
Mutual labels:  webpack, template
Secure Electron Template
The best way to build Electron apps with security in mind.
Stars: ✭ 623 (-48.13%)
Mutual labels:  webpack, template
React App
Create React App with server-side code support
Stars: ✭ 614 (-48.88%)
Mutual labels:  webpack, template
Xhr
A small xhr wrapper
Stars: ✭ 801 (-33.31%)
Mutual labels:  webpack, browserify
Serverless Plugin Typescript
Serverless plugin for zero-config Typescript support
Stars: ✭ 611 (-49.13%)
Mutual labels:  webpack, rollup
Articles Translator
📚Translate the distinct technical blogs. Please star or watch. Welcome to join me.
Stars: ✭ 606 (-49.54%)
Mutual labels:  webpack, parcel
Puppy
Starter kit and delivery system for building static prototypes with Twig
Stars: ✭ 25 (-97.92%)
Mutual labels:  webpack, template
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-97.34%)
Mutual labels:  webpack, template
Panic Overlay
Displays JS errors in browsers. Shows sources. Use with any framework. 💥✨
Stars: ✭ 50 (-95.84%)
Mutual labels:  webpack, parcel
Phaser3template
heroku deployable webpacked phaser3 template with socket.io for multi or single player games
Stars: ✭ 44 (-96.34%)
Mutual labels:  webpack, template

template.js

Build Status license

一款javascript模板引擎,简单,好用,支持webpack, rollup, parcel, browserify, fis和gulp

特性

  • JS原生语法,模版解析,编译,渲染
  • 支持所有浏览器及Node,支持TypeScript
  • 预编译支持主流打包工具
  • 自定义配置、修饰符、函数
  • 支持数据过滤
  • 异常捕获功能
  • 子模版
  • 沙箱模式
  • 支持JIT和AOT两种编译模式
  • 提供cli集成化工具
  • 提供编辑器插件支持

使用者指南

template.js是比拼接字符串更好的方式

模板例子

<ul>
    <%for(var i = 0; i < list.length; i++) {%>
        <li><%:=list[i].name%></li>
    <%}%>
</ul>

数据例子

const data = {
    list: [
        {name: "yan"},
        {name: "haijing"}
    ]
};

渲染输出

<ul>
    <li>yan</li>
    <li>haijing</li>
</ul>

template.js支持的编辑器插件

编辑器 插件
Vscode 高亮插件
Sublime 高亮插件
Atom 高亮插件
WebStorm TODO

通过cli工具快速初始化项目

$ npx @templatejs/cli new myapp
# 选择对应的平台
# ❯ webpack4 
#   rollup 
#   parcel 
#   fis3 
#   browserify 
#   gulp 
#   browser 

如果已有项目,可以选择对应的插件,template.js支持多种使用方式

平台 插件
webpack template-loader
rollup rollup-plugin-templatejs
parcel parcel-plugin-template
fis fis-parser-template
browserify browserify-templatejs
gulp gulp-templatejs
原生web与Node template_js
不支持的平台 可以自己写一个插件,请查看 @templatejs/precompiler

其他packages简介

开发者指南

本项目使用lerna来管理多个插件

安装lerna

$ npm install -g [email protected]

lerna常用命令

$ lerna init # 初始化
$ lerna create @templatejs/parser # 创建一个package
$ lerna add yargs --scope=@templatejs/parser # 给package安装依赖
$ lerna list # 列出所有的包
$ lerna bootstrap # 安装全部依赖
$ lerna link # 建立全部软连接
$ lerna changed # 列出下次发版lerna publish 要更新的包
$ lerna publish # 会打tag,上传git,上传npm

发布步骤,修改changelog

$ yarn test
$ yarn build
$ lerna publish

贡献者列表

contributors

更新日志

CHANGELOG.md

计划列表

TODO.md

谁在使用

想了解都有谁在使用,点击这里

相关链接

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].