UNPKG

pando-computing

Version:

Distribute processing of a stream of items to volunteers on the web.

18 lines (16 loc) 468 B
var browserify = require('browserify') var path = require('path') var fs = require('fs') module.exports = function (modulePath, cb) { var outputPath = path.join(__dirname, '..', 'public', 'bundle.js') browserify(fs.createReadStream(modulePath), { basedir: process.cwd(), standalone: 'bundle' }).bundle().pipe(fs.createWriteStream(outputPath)) .on('close', function () { cb(null, outputPath) }) .on('error', function (err) { cb(err) }) }