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-plus@pdkit/cli@rtscripts/rtorrent-commandsjenkins-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@atomic-object/tscli@ckeditor/ckeditor5-dev-release-tools@gravitywiz/cypress-plugin-gravity-wiz@adpt/cli@cocalc/util-node@cocalc/frontend@cocalc/backend@cocalc/jupyter@commonshost/core@commonshost/edge@coyle-club/kubectl-tsmup-node-versionstrider-gitstrider-hgstrider-localstenoread-nodejstsscheckertiny-care-terminaltradie-utils-flowtoml-to-envtls-keygentogiftiny-git-terminaltwain-scanner-pdf@bb-tools/markdown-magic-utils@bockit/sh@brunwig/mup-aws-beanstalk@chemzqm/solargraph-utilsyarmdwebpack-php-loaderwebpack-node-test-runnerunimailunparse-argsunpackrzeronet-cryptozoj-sandbox@http2/api
0.2.0

11 years ago

0.1.0

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago