node package manager

inline-htmlify

inline-htmlify Build Status

Stream JS code in and get an HTML document out

Install

$ npm install --save inline-htmlify

Usage

var htmlify = require('inline-htmlify')
 
browserify('app.js')
  .pipe(htmlify())
  .pipe(fs.createWriteStream('index.html'))
browserify app.js | htmlify > index.html

Or using a custom document (doc.html):

browserify('app.js')
  .pipe(htmlify(fs.createReadStream('doc.html')))
  .pipe(fs.createWriteStream('index.html'))
cat script.js > htmlify doc.html > index.html

API

htmlify(document) -> stream

Returns a stream that takes in JavaScript and wraps it in an HTML document.

document

A streaming HTML document. The script will be inserted inside a <script inline-htmlify></script> tag. The attribute is used to locate the insertion point and is removed from the final output.

Type: stream
Default: stream of document.html

License

MIT © Ben Drucker