Tabnine Logo For Javascript
minimist
Code IndexAdd Tabnine to your IDE (free)

How to use minimist

Best JavaScript code snippets using minimist(Showing top 15 results out of 576)

origin: clinicjs/node-clinic

// support --path to support failure testing
   clean(args.path || '.', function (err) {
    if (err) throw err
   })
origin: Netflix/pollyjs

function determineEnv() {
 if (process.env.EMBER_ENV) {
  return process.env.EMBER_ENV;
 }

 let args = parseArgs(process.argv);
 let env = args.e || args.env || args.environment;

 // Is it "ember b -prod" or "ember build --prod" command?
 if (
  !env &&
  (process.argv.indexOf('-prod') > -1 || process.argv.indexOf('--prod') > -1)
 ) {
  env = 'production';
 }

 // Is it "ember test" or "ember t" command without explicit env specified?
 if (
  !env &&
  (process.argv.indexOf('test') > -1 || process.argv.indexOf('t') > -1)
 ) {
  env = 'test';
 }

 return env || 'development';
}
origin: clinicjs/node-clinic

catchify(async function (argv) {
  const args = minimist(argv, {
   alias: {
    help: 'h'
  if (args.help) {
   printHelp('clinic-ask')
  } else if (args._.length > 0) {
   await checkMetricsPermission()
   insight.trackEvent({
origin: clinicjs/node-clinic

commist()
 .register('user', function (argv) {
  const args = minimist(argv, {
   alias: {
    help: 'h'
  if (args.h) {
   printHelp('clinic-user')
   process.exit(0)
  if (args.server) {
   authenticate.getSession(args.server).then((user) => {
    if (!user) throw new Error('Expired')
    printUser(user)
  const args = minimist(argv, {
   alias: {
    help: 'h'
  if (args.h) {
   printHelp('clinic-login')
   process.exit(0)
  authenticate(args.server).then((authToken) => {
   const header = jwt.decode(authToken)
   if (header.name) {
 })
 .register('logout', function (argv) {
  const args = minimist(argv, {
origin: binci/binci

if (args.raw._ && args.raw._[0] === 'init') {
 try {
origin: webtorrent/webtorrent-cli

function torrentDone () {
 if (argv['on-done']) {
  cp.exec(argv['on-done']).unref()
 }

 if (!playerName && !serving && argv.out && !argv['keep-seeding']) {
  gracefulExit()
 }
}
origin: webtorrent/webtorrent-cli

torrent.on('done', () => {
  if (!argv.quiet) {
   const numActiveWires = torrent.wires
    .reduce((num, wire) => num + (wire.downloaded > 0), 0)

   clivas.line('')
   clivas.line(
    'torrent downloaded {green:successfully} from {bold:%s/%s} {green:peers} ' +
    'in {bold:%ss}!', numActiveWires, torrent.numPeers, getRuntime()
   )
  }

  torrentDone()
 })
origin: ibm-functions/composer

conductor(options).compositions.deploy(composition, argv.overwrite)
 .then(actions => {
  const names = actions.map(action => action.name)
  console.log(`ok: created action${actions.length > 1 ? 's' : ''} ${names}`)
 })
 .catch(error => {
  error.statusCode = error.statusCode || 500
  console.error(error)
  process.exit(error.statusCode - 256)
 })
origin: feross/available

function run (online) {
 if (argv._[0]) {
  runCheckName(argv._[0], online)
 } else {
  runGetNames(online)
 }
}
origin: nodejs/changelog-maker

const getFormat = () => {
 if (argv.simple || argv.s) {
  return formatType.SIMPLE
 } else if (argv.plaintext || argv.p) {
  return formatType.PLAINTEXT
 }
 return formatType.MARKDOWN
}
origin: feross/available

function runCheckName (name, online) {
 available.checkName(name, {
  online,
  related: argv.related
 }, printName)
}
origin: urbica/tessella

app.listen(handler, () => {
 if (config.socket) {
  fs.chmodSync(config.socket, '1766');
  process.stdout.write(`🚀  ON AIR @ ${config.socket}`);
 } else {
  const endpoint = `${server.address().address}:${server.address().port}`;
  process.stdout.write(`🚀  ON AIR @ ${endpoint}`);
 }
})
origin: cmints/cmints

// THIS TEST IS CALLED DIRECTLY
  describe(`Testing static content generation ${argv.testgzip ? "" : "with cache"}`, () =>
  {
   testCaching();
   testPermalinkGeneration();
   generationIndex();
   after((done) =>
   {
    done();
   });
  });
origin: webtorrent/webtorrent-cli

server.listen(argv.port, initServer)
  .on('error', err => {
   if (err.code === 'EADDRINUSE' || err.code === 'EACCES') {
    // If port is taken, pick one a free one automatically
    return server.listen(0, initServer)
   }

   return fatalError(err)
  })
origin: Netflix/pollyjs

function determineEnv() {
 if (process.env.EMBER_ENV) {
  return process.env.EMBER_ENV;
 }

 let args = parseArgs(process.argv);
 let env = args.e || args.env || args.environment;

 // Is it "ember b -prod" or "ember build --prod" command?
 if (
  !env &&
  (process.argv.indexOf('-prod') > -1 || process.argv.indexOf('--prod') > -1)
 ) {
  env = 'production';
 }

 // Is it "ember test" or "ember t" command without explicit env specified?
 if (
  !env &&
  (process.argv.indexOf('test') > -1 || process.argv.indexOf('t') > -1)
 ) {
  env = 'test';
 }

 return env || 'development';
}
minimist(npm)

JSDoc

parse argument options

Most used minimist functions

  • ParsedArgs._
    Contains all the arguments that didn't have an option associated with them
  • minimist
  • ParsedArgs.version
  • ParsedArgs.help
  • ParsedArgs.d
  • ParsedArgs.h,
  • ParsedArgs.p,
  • ParsedArgs.port,
  • ParsedArgs.verbose,
  • ParsedArgs.debug,
  • ParsedArgs.e,
  • ParsedArgs.fix,
  • ParsedArgs.n,
  • ParsedArgs.o,
  • ParsedArgs.plugin,
  • ParsedArgs.v,
  • ParsedArgs.all,
  • ParsedArgs.c,
  • ParsedArgs.clean

Popular in JavaScript

  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • http
  • body-parser
    Node.js body parsing middleware
  • async
    Higher-order functions and common patterns for asynchronous code
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • postcss
  • glob
    a little globber
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • mime-types
    The ultimate javascript content-type utility.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now