intreq-stream
v1.0.0
Published
A more direct streaming interface for intreq
Downloads
12
Maintainers
Readme
intreq-stream
A more direct streaming interface for intreq, which removes any file paths from your bundles.
Generally it's nicer using it directly, but the browser-unpack module API would otherwise require you breaking your pipeline. This lets you pipe your JS in and get JS out the other side :)
Usage
intreqStream()
Creates a transform stream which accepts a browserify bundle as input, and outputs the same browserify bundle with its paths removed.
// Squish a browserify bundle as much
// as it can be squished:
var intreq = require('intreq-stream')
var browserify = require('browserify')
var uglifyify = require('uglifyify')
var src = __dirname + '/index.js'
browserify({
fullPaths: false,
debug: false,
entries: [src]
}).transform(uglifyify, { sourcemap: false })
.bundle()
.pipe(intreq())
.pipe(uglifyify(src, { sourcemap: false }))
.pipe(fs.createWriteStream(__dirname + '/bundle.js'))
License
MIT. See LICENSE.md for details.