JSPM

parse-spawn-args

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1705
  • Score
    100M100P100Q120168F
  • License ISC

parse string to spawn recognized arguments list

Package Exports

  • parse-spawn-args

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-spawn-args) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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"'
    ]
*/