0.2.0 • Published 11 years ago

shell-escape v0.2.0

Weekly downloads
103,345
License
MIT
Repository
github
Last release
11 years ago

shell-escape

Escape and stringify an array of arguments to be executed on the shell

Install

npm install shell-escape

Example

simple

var shellescape = require('shell-escape');

var args = ['curl', '-v', '-H', 'Location;', '-H', 'User-Agent: dave#10', 'http://www.daveeddy.com/?name=dave&age=24'];

var escaped = shellescape(args);
console.log(escaped);

yields

curl -v -H 'Location;' -H 'User-Agent: dave#10' 'http://www.daveeddy.com/?name=dave&age=24'

A command suitable for being executed by the shell

advanced

var shellescape = require('shell-escape');

var args = ['echo', 'hello!', 'how are you doing $USER', '"double"', "'single'"];

var escaped = shellescape(args);
console.log(escaped);

yields

echo 'hello!' 'how are you doing $USER' '"double"' \''single'\'

and when run on the shell

$ echo 'hello!' 'how are you doing $USER' '"double"' \''single'\'
hello! how are you doing $USER "double" 'single'

License

MIT

chroot-sandboxenebular-privatenode-contrib-grove-base-hat@src-works/npm-ts-gulpparsable-bulk-user@annoai/shelljs-promise@infinitebrahmanuniverse/nolb-shel@everything-registry/sub-chunk-2749tamia-changelogt2-cliwirebird-clientwindows-docker-machinewinrarjswebchat-cliwpsyncwpvip-cliwp-local-dockerxlsx2sqltemplate-anythingspeech-serverstartfromvue-cli-plugin-ice-buildervue-cli-plugin-ut-buildervideofyvideofy-plusjenkins-mochakalabox-cliirestorejuto-mup-aws-beanstalklanguage-stringshubot-sayhttp-inspectorheroku-appsheroku-cihghlvlherokuheic-to-jpeg-middlewarehatimeria-hatgulp-scss-lintios-crashlint-unpushedlinux-win-poslerna-subtree-publishllvmbc-wasm-loaderlivepushmagesecmechanicm3u-exportlndupmega-cluster@wpdocker/wpdocker@ubud-app/server@tolmasky/dockerscript@termftp/node-ssh@thirut.t/mup-aws-beanstalk@tradie/flow-utils@vilango/mup-aws-beanstalk@useoptic/ui@zeusdeux/create-ts-project@zigvycorp/mup-aws-beanstalkappql-cliaspell-stream@gravitywiz/cypress-plugin-gravity-wiz@panter/catladder-build@nrser/jash@http2/edge@hubroeducation/mup-aws-beanstalk@heroku-cli/plugin-apps@heroku-cli/plugin-apps-v5@heroku-cli/plugin-ci-v5@heroku-cli/config@pdfmonkey/cli@pdkit/clifs-path@technote-space/github-action-helper@stackgen/cli@t3rminus/mechanic@tartarus/datadz-node-sshdtflsecrinember-cli-deploy-shentitlementsember-cli-s3-syncember-cli-deploy-storybookencode-ffmpegenv-to-envepub-checkfirefox-wrapperfirefox-nightly-prebuilt@preevy/core@bockit/sh@brunwig/mup-aws-beanstalk@chemzqm/solargraph-utils@ckeditor/ckeditor5-dev-release-tools@bb-tools/markdown-magic-utilscapture-screenshot-phantomjsci-scriptscomposablecapture-electroncapture-firefox
0.2.0

11 years ago

0.1.0

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago