scriptify
Browserify inline script tags in HTML.
example
We have a index.html
page with:
Then as we serve the HTML we can transform it:
var scriptify = // Bundle an HTML filefs // Or bundle as the server requests it:var http = var fs = httpconsole
require('scriptify')([options])
Returns a Stream
.
options
:selector
: Defaults toscript[type="text/browserify"]
.args
: Defaults to[]
. Arguments to pass tobrowserify
.
Is this a good idea?
I don't know. Probably not. I'm just being lazy and sometimes don't want to have a separate file for an entry point.
install
With npm do:
npm install scriptify
release history
- 1.0.0 - Skip external sources. (@karissa)
- 0.2.0 - Use script src attribute if available. Upgrade browserify and cheerio. (@maxogden)
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.