Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oresoftware/parse-command
Parse an arbitrary command string, reliably, using a child process.
https://github.com/oresoftware/parse-command
bash child-process node nodejs npm
Last synced: 4 months ago
JSON representation
Parse an arbitrary command string, reliably, using a child process.
- Host: GitHub
- URL: https://github.com/oresoftware/parse-command
- Owner: ORESoftware
- License: mit
- Created: 2018-04-17T22:32:32.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T04:58:19.000Z (over 6 years ago)
- Last Synced: 2024-10-25T05:26:45.309Z (4 months ago)
- Topics: bash, child-process, node, nodejs, npm
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Parse a command using bash/OS
### Installation
```bash
$ npm i parse-command
```### Usage
```javascript
const {parseCommand} = require('parse-command');parseCommand('--foo=5 --bar="/a file/path" --zoom -z', function(err, val){
// val is parsed array
// val => [ '--foo=5', '--bar=/a file/path', '--zoom', '-z' ]
});// using promises
const {parseCommandp} = require('parse-command');parseCommandp('--foo=5 --bar="/a file/path" --zoom -z').then(function(val){
// val is parsed array
// val => [ '--foo=5', '--bar=/a file/path', '--zoom', '-z' ]
});```