Skip to content

A node.js module to parse string to a argument list which can used by process spawn

License

Notifications You must be signed in to change notification settings

mingqi/parse-spawn-args

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A node.js module to parse string to a argument list which can used by process spawn

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published