parse-spawn-args-ng
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

parse-spawn-args-ng

💡 This module is based 100% on parse-spawn-args.

If you need to spawn child process in Node.js, and need to parse a string command to a list arguments that pass to child process, this module will be helpful. Here is examples:

usage

parse args with quote around

var parse = require('parse-spawn-args').parse
parse('-port 80 --title "this is a title"')
/*
    [
        '-port',
        '80',
        '--title',
        'this is a title'
    ]
/*

parse args with quote escape

var parse = require('parse-spawn-args').parse
parse('-port 80 --title "this is a \\"title\\"')
/*
    [
        '-port',
        '80',
        '--title',
        'this is a "title"'
    ]
*/

new features

  • updated to latest pegjs version
  • fixed undeclared variables issue on generated code with strict mode
  • types added
  • bundle to esm + cjs using esbuild

Package Sidebar

Install

npm i parse-spawn-args-ng

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

89.9 kB

Total Files

8

Last publish

Collaborators

  • jabiinfante