How to use the nopt.apply function in nopt

To help you get started, we’ve selected a few nopt 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 mklabs / gimme-assets / lib / gimme / plugins / cli.js View on Github external
cli.nopt = function _nopt(options) {
  var app = this;
  this.nopt = this.opts = nopt.apply(this, options);
  this.argv = this.nopt.argv;

  if(this.config) {
    // sets up each option parsed by nopt as top level prop in app.config
    Object.keys(this.nopt).forEach(function(key) {
      if(key !== 'argv') app.config.set(key, app.nopt[key]);
    });
  }
};

nopt

Option parsing for Node, supporting types, shorthands, etc. Used by npm.

ISC
Latest version published 2 months ago

Package Health Score

92 / 100
Full package analysis