Gathering detailed insights and metrics for shell-quote
Gathering detailed insights and metrics for shell-quote
Gathering detailed insights and metrics for shell-quote
Gathering detailed insights and metrics for shell-quote
npm install shell-quote
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
4,206,737,404
Last Day
1,409,077
Last Week
25,979,546
Last Month
112,428,031
Last Year
1,140,578,067
MIT License
40 Stars
206 Commits
12 Forks
4 Watchers
2 Branches
18 Contributors
Updated on Jul 05, 2025
Minified
Minified + Gzipped
Latest Version
1.8.3
Package Id
shell-quote@1.8.3
Unpacked Size
23.19 kB
Size
8.14 kB
File Count
18
NPM Version
11.3.0
Node Version
24.1.0
Published on
Jun 02, 2025
Cumulative downloads
Total Downloads
Parse and quote shell commands.
1var quote = require('shell-quote/quote'); 2var s = quote([ 'a', 'b c d', '$f', '"g"' ]); 3console.log(s);
output
a 'b c d' \$f '"g"'
1var parse = require('shell-quote/parse'); 2var xs = parse('a "b c" \\$def \'it\\\'s great\''); 3console.dir(xs);
output
[ 'a', 'b c', '\\$def', 'it\'s great' ]
1var parse = require('shell-quote/parse'); 2var xs = parse('beep --boop="$PWD"', { PWD: '/home/robot' }); 3console.dir(xs);
output
[ 'beep', '--boop=/home/robot' ]
1var parse = require('shell-quote/parse'); 2var xs = parse('beep ^--boop="$PWD"', { PWD: '/home/robot' }, { escape: '^' }); 3console.dir(xs);
output
[ 'beep --boop=/home/robot' ]
1var parse = require('shell-quote/parse'); 2var xs = parse('beep || boop > /byte'); 3console.dir(xs);
output:
[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]
1var parse = require('shell-quote/parse'); 2var xs = parse('beep > boop # > kaboom'); 3console.dir(xs);
output:
[ 'beep', { op: '>' }, 'boop', { comment: '> kaboom' } ]
1var quote = require('shell-quote/quote'); 2var parse = require('shell-quote/parse');
Return a quoted string for the array args
suitable for using in shell
commands.
Return an array of arguments from the quoted string cmd
.
Interpolate embedded bash-style $VARNAME
and ${VARNAME}
variables with
the env
object which like bash will replace undefined variables with ""
.
env
is usually an object but it can also be a function to perform lookups.
When env(key)
returns a string, its result will be output just like env[key]
would. When env(key)
returns an object, it will be inserted into the result
array like the operator objects.
When a bash operator is encountered, the element in the array with be an object
with an "op"
key set to the operator string. For example:
'beep || boop > /byte'
parses as:
[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]
With npm do:
npm install shell-quote
MIT
9.8/10
Summary
Improper Neutralization of Special Elements used in a Command in Shell-quote
Affected Versions
<= 1.7.2
Patched Versions
1.7.3
9.8/10
Summary
Potential Command Injection in shell-quote
Affected Versions
< 1.6.1
Patched Versions
1.6.1
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
-4.5%
1,409,077
Compared to previous day
Last Week
-7.9%
25,979,546
Compared to previous week
Last Month
1.4%
112,428,031
Compared to previous month
Last Year
30.7%
1,140,578,067
Compared to previous year