jsify

Convert text files to JavaScript modules

npm install jsify
3 downloads in the last week
16 downloads in the last month

jsify

Convert text files into requireable JavaScript modules

Install

$ npm install jsify

Usage

Single file:

$ jsify templates/foo.html -o lib/templates/foo.js
require('./templates/foo')
// => "<html>this is foo.html</html>"

Multiple files:

$ jsify templates/**/*.html -o lib/templates.js
templates = require('./templates')

templates.foo
// => "<html>this is foo.html</html>"

templates.bar
// => "<html>this is foo.html</html>"

templates['eggs/qux']
// => "<html>this is eggs/qux.html</html>"

templates['eggs/corge']
// => "<html>this is eggs/corge.html</html>"

npm loves you