How to use the minimist._ function in minimist

To help you get started, we’ve selected a few minimist 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 threepointone / ratpack / src / main.js View on Github external
// import installExtension, { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer'

// app: control application file.
// BrowserWindow: create native browser window.

import { app, BrowserWindow }  from 'electron'
import path from 'path'

let isProd = path.basename(process.argv[0]).indexOf('ratpack') === 0

let startsWith = require('minimist')(process.argv.slice(1))._[ isProd ? 0 : 1]
let startedOnce = false
let mainWindow

app.on('open-file', (e, filepath) => {
  if(!mainWindow ) {
    startsWith = filepath
    if(!startedOnce) {      
      return
    }    
    createWindow()    
    return 
  }    
})
 
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
github vigetlabs / blendid / bin / blendid.js View on Github external
#!/usr/bin/env node
const path = require('path')

const additionalArgs = require('minimist')(process.argv.slice(2))._
const blendidEntryDir = path.resolve(__dirname, '../gulpfile.js')
const gulpModulePath = path.dirname(require.resolve('gulp'))
const gulpBinaryFile = path.join(gulpModulePath, '/bin/gulp')

let args = ['--gulpfile', blendidEntryDir]

if(additionalArgs.length) {
  args = args.concat(additionalArgs)
}

require('child_process').fork(gulpBinaryFile, args)
github postcss / postcss-selector-parser / batchTests.js View on Github external
#!/usr/bin/env node

var glob = require('glob');
var spawn = require('child_process').spawn;
var files = require('minimist')(process.argv.slice(2))._[0];

function throttlePromise (myArray, iterator, limit) {
    var pickUpNextTask = function () {
        if (myArray.length) {
            return iterator(myArray.shift());
        }
    };
  
    function startChain () {
        return Promise.resolve().then(function next () {
            return pickUpNextTask().then(next);
        });
    }

    var chains = [];
    for (var k = 0; k < limit; k += 1) {
github vigetlabs / blendid / bin / blendid-karma.js View on Github external
#!/usr/bin/env node
const additionalArgs = require('minimist')(process.argv.slice(2))._

let args = ['start', 'node_modules/blendid/karma.conf']

if(additionalArgs.length) {
  args = args.concat(additionalArgs)
}

require('child_process').fork('node_modules/karma/bin/karma', args)