Skip to content

julesbou/combine-html

Repository files navigation

Combine HTML Build Status

Combine HTML templates in a JavaScript file

npm install combine-html

Motivation

There's already lots of tools allowing you to combine html files into a single one, but they all depend on grunt or gulp or webpack or requirejs or browserify... My need was to combine those html files with one simple command and nothing more.

Cli

npm install combine-html -g
combine-html -h

combine-html templates/**/*.html > templates.js
combine-html templates/**/*.html --root templates/ > templates.js
combine-html templates/**/*.html --amd > templates.js
combine-html templates/**/*.html --commonJS > templates.js
combine-html templates/**/*.html --es2015 > templates.js
combine-html templates/**/*.html --global myVar > templates.js

Node

combine() returns a JavaScript Promise:

const combine = require('combine-html')

combine('templates/**/*.html')
combine('templates/**/*.html', { root: 'templates/' })
combine('templates/**/*.html', { amd: true })
combine('templates/**/*.html', { commonJS: true })
combine('templates/**/*.html', { es2015: true })
combine('templates/**/*.html', { global: 'myVar' })

You can use any directory pattern recognized by node-glob.

About

Simple Shell command to combine HTML templates in a JavaScript file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published