Convert text files into requireable JavaScript modules
JavaScript Perl
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
docs
lib
.gitignore
.npmignore
README.md
index.js
package.json

README.md

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>"