2.0.1 • Published 8 years ago
inline-htmlify v2.0.1
inline-htmlify 
Stream JS code in and get an HTML document out
Install
$ npm install --save inline-htmlifyUsage
var htmlify = require('inline-htmlify')
browserify('app.js')
.pipe(htmlify())
.pipe(fs.createWriteStream('index.html'))browserify app.js | htmlify > index.htmlOr 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.htmlThe 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