parse-node-args

1.1.2 • Public • Published

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"]);

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i parse-node-args

    Weekly Downloads

    226

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    4.92 kB

    Total Files

    6

    Last publish

    Collaborators

    • lulavalva
    • tigt
    • ryanturnquist
    • dylanpiercey
    • ryansolid
    • mlrawlings
    • agliga