How to use the args.options function in args

To help you get started, we’ve selected a few args 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 harrison-ifeanyichukwu / rollup-all / bin / index.js View on Github external
#!/usr/bin/env node
const args = require('args');

args.options([
  {
    name: 'dir',
    description: 'defines the directory to locate the cjs build output',
    defaultValue: '../build'
  }
]);

const flags = args.parse(process.argv);
const getEntryPath = require('@forensic-js/node-utils').getEntryPath;
const loadFile = require(`${flags.dir}/modules/utils`).loadFile;
const Bundler = require(`${flags.dir}/modules/Bundler`).Bundler;

const entryPath = getEntryPath();
const options = loadFile(entryPath, 'rollup.config.js');

const bunder = new Bundler(options);