parse-node-args
v1.1.2
Published
Extract node cli options from a list of flags.
Downloads
959
Readme
parse-node-args
Utility to extract all valid node flags from a list of process args.
Install
npm install --save parse-node-args
Usage
cmd
node ./cli.js --inspect-brk --custom-option
cli.js
import { deepEqual } from "assert";
import parseNodeArgs from "parse-node-args";
const { nodeArgs, cliArgs } = parseNodeArgs(process.argv);
deepEqual(nodeArgs, ["--inspect-brk"]);
deepEqual(cliArgs, ["--custom-option"]);