forked from goliasse/opencbs-online
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
61 lines (61 loc) · 3.66 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
"name": "shell-quote",
"version": "1.4.2",
"description": "quote and parse shell commands",
"main": "index.js",
"devDependencies": {
"tape": "~2.3.0"
},
"scripts": {
"test": "tape test/*.js"
},
"repository": {
"type": "git",
"url": "http://github.com/substack/node-shell-quote.git"
},
"keywords": [
"shell",
"command",
"quote",
"parse"
],
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"firefox/3.5",
"firefox/15..latest",
"firefox/nightly",
"chrome/25..latest",
"chrome/canary",
"opera/10..latest",
"opera/next",
"safari/5.1..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2..latest"
]
},
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"license": "MIT",
"dependencies": {
"jsonify": "~0.0.0",
"array-filter": "~0.0.0",
"array-reduce": "~0.0.0",
"array-map": "~0.0.0"
},
"readme": "# shell-quote\n\nParse and quote shell commands.\n\n[![build status](https://secure.travis-ci.org/substack/node-shell-quote.png)](http://travis-ci.org/substack/node-shell-quote)\n\n[![browser support](https://ci.testling.com/substack/node-shell-quote.png)](https://ci.testling.com/substack/node-shell-quote)\n\n# example\n\n## quote\n\n``` js\nvar quote = require('shell-quote').quote;\nvar s = quote([ 'a', 'b c d', '$f', '\"g\"' ]);\nconsole.log(s);\n```\n\noutput\n\n```\na 'b c d' \\$f '\"g\"'\n```\n\n## parse\n\n``` js\nvar parse = require('shell-quote').parse;\nvar xs = parse('a \"b c\" \\\\$def \\'it\\\\\\'s great\\'');\nconsole.dir(xs);\n```\n\noutput\n\n```\n[ 'a', 'b c', '\\\\$def', 'it\\'s great' ]\n```\n\n## parse with an environment variable\n\n``` js\nvar parse = require('shell-quote').parse;\nvar xs = parse('beep --boop=\"$PWD\"', { PWD: '/home/robot' });\nconsole.dir(xs);\n```\n\noutput\n\n```\n[ 'beep', '--boop=/home/robot' ]\n```\n\n## parsing shell operators\n\n``` js\nvar parse = require('shell-quote').parse;\nvar xs = parse('beep || boop > /byte');\nconsole.dir(xs);\n```\n\noutput:\n\n```\n[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]\n```\n\n# methods\n\n``` js\nvar quote = require('shell-quote').quote;\nvar parse = require('shell-quote').parse;\n```\n\n## quote(args)\n\nReturn a quoted string for the array `args` suitable for using in shell\ncommands.\n\n## parse(cmd, env={})\n\nReturn an array of arguments from the quoted string `cmd`.\n\nInterpolate embedded bash-style `$VARNAME` and `${VARNAME}` variables with\nthe `env` object which like bash will replace undefined variables with `\"\"`.\n\n`env` is usually an object but it can also be a function to perform lookups.\nWhen `env(key)` returns a string, its result will be output just like `env[key]`\nwould. When `env(key)` returns an object, it will be inserted into the result\narray like the operator objects.\n\nWhen a bash operator is encountered, the element in the array with be an object\nwith an `\"op\"` key set to the operator string. For example:\n\n```\n'beep || boop > /byte'\n```\n\nparses as:\n\n```\n[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install shell-quote\n```\n\n# license\n\nMIT\n",
"readmeFilename": "readme.markdown",
"bugs": {
"url": "https://github.com/substack/node-shell-quote/issues"
},
"homepage": "https://github.com/substack/node-shell-quote",
"_id": "shell-quote@1.4.2",
"_shasum": "f132a54f2030d69280d370d4974155f85f62f67b",
"_from": "shell-quote@~1.4.1",
"_resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.4.2.tgz"
}