Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var argv = parseArgs(args, opts)
// if no stream is specified, default to stdout
if (argv.stream !== false) {
argv.stream = /^win/.test(process.platform) ? process.stdout : stdoutStream
}
var entries = argv._
delete argv._
argv.browserifyArgs = argv['--']
delete argv['--']
if (argv.version) {
console.log('budo v' + require('./package.json').version)
console.log('browserify v' + require('browserify/package.json').version)
console.log('watchify v' + require('watchify-middleware').getWatchifyVersion())
return null
}
if (argv.help) {
var help = require('path').join(__dirname, 'bin', 'help.txt')
require('fs').createReadStream(help)
.pipe(process.stdout)
return null
}
if (argv.outfile) {
console.error(color.yellow('WARNING'), '--outfile has been removed in budo@3.0')
}
if (typeof argv.port === 'string') {
var fs = require('fs');
var path = require('path');
var outpipe = require('outpipe');
var fromArgs = require('./args.js');
var w = fromArgs(process.argv.slice(2));
var outfile = w.argv.o || w.argv.outfile;
var verbose = w.argv.v || w.argv.verbose;
if (w.argv.version) {
console.error('watchify v' + require('../package.json').version +
' (in ' + path.resolve(__dirname, '..') + ')'
);
console.error('browserify v' + require('browserify/package.json').version +
' (in ' + path.dirname(require.resolve('browserify')) + ')'
);
return;
}
if (!outfile) {
console.error('You MUST specify an outfile with -o.');
process.exit(1);
}
var bytes, time;
w.on('bytes', function (b) { bytes = b });
w.on('time', function (t) { time = t });
w.on('update', bundle);
bundle();
var path = require('path');
var outpipe = require('outpipe');
var through = require('through2');
var fromArgs = require('./args.js');
var w = fromArgs(process.argv.slice(2));
var outfile = w.argv.o || w.argv.outfile;
var verbose = w.argv.v || w.argv.verbose;
if (w.argv.version) {
console.error('watchify v' + require('../package.json').version +
' (in ' + path.resolve(__dirname, '..') + ')'
);
console.error('browserify v' + require('browserify/package.json').version +
' (in ' + path.dirname(require.resolve('browserify')) + ')'
);
return;
}
if (!outfile) {
console.error('You MUST specify an outfile with -o.');
process.exit(1);
}
var bytes, time;
w.on('bytes', function (b) { bytes = b });
w.on('time', function (t) { time = t });
w.on('update', bundle);
bundle();
cacheDir,
command: _argv.join( ' ' ),
neverCache,
watch,
recreate
}, process.argv.slice( 2 ) );
var outfile = w.argv.o || w.argv.outfile;
var verbose = w.argv.v || w.argv.verbose;
if ( w.argv.version ) {
nodeConsole.error( 'persistify v' + require( '../package.json' ).version +
' (in ' + path.resolve( __dirname, '..' ) + ')' );
nodeConsole.error( 'watchify v' + require( 'watchify/package.json' ).version +
' (in ' + path.dirname( require.resolve( 'watchify' ) ) + ')' );
nodeConsole.error( 'browserify v' + require( 'browserify/package.json' ).version +
' (in ' + path.dirname( require.resolve( 'browserify' ) ) + ')' );
return;
}
if ( !outfile ) {
nodeConsole.error( 'You MUST specify an outfile with -o.' );
process.exit( 1 ); //eslint-disable-line
}
var bytes, time;
if ( watch ) {
w.on( 'bytes', function ( b ) {
bytes = b;
} );
w.on( 'time', function ( t ) {
time = t;
getBrowserifyVersion () {
try {
const pkg = require('browserify/package.json')
return pkg.version
} catch (err) {
throw new this.serverless.classes.Error('Required peer dependency \'browserify\' is not installed.', 'skip')
}
},