npm install shell-quote
99.7
Supply Chain Risk
100
Quality
80.9
Maintenance
100
Vulnerability
24 Stars
198 Commits
10 Forks
3 Watching
2 Branches
17 Contributors
Updated on 23 Aug 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
7.4%
3,888,582
Compared to previous day
Last week
8.5%
19,885,003
Compared to previous week
Last month
4.2%
84,209,735
Compared to previous month
Last year
20.9%
915,200,374
Compared to previous year
Parse and quote shell commands.
var quote = require('shell-quote/quote'); var s = quote([ 'a', 'b c d', '$f', '"g"' ]); console.log(s);
output
a 'b c d' \$f '"g"'
var parse = require('shell-quote/parse'); var xs = parse('a "b c" \\$def \'it\\\'s great\''); console.dir(xs);
output
[ 'a', 'b c', '\\$def', 'it\'s great' ]
var parse = require('shell-quote/parse'); var xs = parse('beep --boop="$PWD"', { PWD: '/home/robot' }); console.dir(xs);
output
[ 'beep', '--boop=/home/robot' ]
var parse = require('shell-quote/parse'); var xs = parse('beep ^--boop="$PWD"', { PWD: '/home/robot' }, { escape: '^' }); console.dir(xs);
output
[ 'beep --boop=/home/robot' ]
var parse = require('shell-quote/parse'); var xs = parse('beep || boop > /byte'); console.dir(xs);
output:
[ 'beep', { op: '||' }, 'boop', { op: '>' }, '/byte' ]
var parse = require('shell-quote/parse'); var xs = parse('beep > boop # > kaboom'); console.dir(xs);
output:
[ 'beep', { op: '>' }, 'boop', { comment: '> kaboom' } ]
var quote = require('shell-quote/quote'); var 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
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-09-02
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 More@mergesium/shell-quote
quote and parse shell commands
@types/shell-quote
TypeScript definitions for shell-quote
@juigorg/nisi-molestiae-ut
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
@erboladaiorg/esse-ipsa-numquam
<p align="center"> <img width="250" src="https://raw.githubusercontent.com/@erboladaiorg/esse-ipsa-numquam/@erboladaiorg/esse-ipsa-numquam/main/@erboladaiorg/esse-ipsa-numquam-logo.png"> </p> <h1 align="center"> Yargs </h1> <p align="center"> <b >Yarg