How to use the browserify/package.json.version function in browserify

To help you get started, we’ve selected a few browserify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattdesl / budo / index.js View on Github external
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') {
github aredotna / ervell / node_modules / browserify-dev-middleware / node_modules / watchify / bin / cmd.js View on Github external
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();
github browserify / watchify / bin / cmd.js View on Github external
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();
github royriojas / persistify / bin / cmd.js View on Github external
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;
github digitalmaas / serverless-plugin-browserifier / lib / configure.js View on Github external
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')
    }
  },