Polymer compatible HTML5 based templating syntax for node.js. Render your templates server-side using the same syntax as in the browser, with no virtual DOM trickery required.
For a full demonstration, please see htmling-demo-app.
npm install htmling
User ListUser ListAliceGeorge
How it works
Unlike similar libraries, HTMLing does not require a virtual DOM such as jsDOM. Instead, HTMLing
HTMLing is easy to integrate with your existing build process, either via the command line or library interfaces.
HTMLing ships with a small command line interface:
Compile an individual file
The compiled output will be written to STDOUT
Compile an individual file to a destination
The compiled output will be written to
htmling -o ./compiled.js ./file.html
Compile a directory hierarchy
Compile a nested directory structure to a directory called
compiled. The output
directory will be created if it does not already exist, and the resulting folder structure will
match that of the input.
htmling -o ./compiled ./pages
Compile a directory hierarchy to a single file
Compile a nested directory structure to a single called
htmling -c -o ./compiled.js ./pages
As a Library
It's also possible to use HTMLing as a library:
Compile a string
var HTMLing = ;var template = HTMLing;console; // "Hello Charles"
Compile a file
var template = HTMLing;console;
Compile a directory
var templates = HTMLingdir'./pages';console
Using as an express view engine
HTMLing has support for express.js.
var HTMLing = ;app;
In development mode, you'll probably want to enable the
watch option. This will reload your
templates when they change on disk:
var HTMLing = ;app;
MIT, see LICENSE.md.
All you need is Docker with
docker-compose available from your terminal.
We have a fancy shortcut to get your application up and running, and you also get access to the container terminal:
$ make build$ make run
From this point, it's just a matter of starting the application from within the container shell:
htmling:~/app(master)$ npm test
Other fancy shortcuts we have for Docker fans
$ make into open a new container terminal
$ make stopto stop all containers
$ make cleanto clean the Docker environment