inline-htmlify

2.0.1 • Public • Published

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

The html file doc.html should have a <script> tag with the attribute inline-htmlify:

<script inline-htmlify></script>

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.1
    25
    • latest

Version History

Package Sidebar

Install

npm i inline-htmlify

Weekly Downloads

23

Version

2.0.1

License

MIT

Last publish

Collaborators

  • bendrucker