{"name":"shell-quote","description":"quote and parse shell commands","version":"1.8.2","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"funding":{"url":"https://github.com/sponsors/ljharb"},"bugs":{"url":"https://github.com/ljharb/shell-quote/issues"},"devDependencies":{"@ljharb/eslint-config":"^21.1.1","auto-changelog":"^2.5.0","encoding":"^0.1.13","eslint":"=8.8.0","evalmd":"^0.0.19","in-publish":"^2.0.1","jackspeak":"=2.1.1","npmignore":"^0.3.1","nyc":"^10.3.2","safe-publish-latest":"^2.0.0","tape":"^5.9.0"},"homepage":"https://github.com/ljharb/shell-quote","keywords":["command","parse","quote","shell"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git+ssh://git@github.com/ljharb/shell-quote.git"},"scripts":{"prepack":"npmignore --auto --commentLines=autogenerated","prepublish":"not-in-publish || npm run prepublishOnly","prepublishOnly":"safe-publish-latest","prelint":"evalmd README.md","lint":"eslint --ext=js,mjs .","pretest":"npm run lint","tests-only":"nyc tape 'test/**/*.js'","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","version":"auto-changelog && git add CHANGELOG.md","postversion":"auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""},"auto-changelog":{"output":"CHANGELOG.md","template":"keepachangelog","unreleased":false,"commitLimit":false,"backfillLimit":false,"hideCredit":true,"startingVersion":"1.7.4"},"publishConfig":{"ignore":[".github/workflows","example","CHANGELOG.md"]},"engines":{"node":">= 0.4"},"_id":"shell-quote@1.8.2","gitHead":"b19fc77e66871eee10a9978d54c27d802a1da99b","_nodeVersion":"23.3.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==","shasum":"d2d83e057959d53ec261311e9e9b8f51dcb2934a","tarball":"http://registry-npm.ywwl.com/shell-quote/download/shell-quote-1.8.2.tgz","fileCount":17,"unpackedSize":23539,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDIsqVpKTipvRLTIsLts+/3fj4ea0gdx4I+vW97QnYdRAiEA/Q6bf9Be3o+tvPXaDWrMA/AtIg12KcSra/jpb1YlgQg="}],"size":8236,"noattachment":false,"key":"/shell-quote/-/shell-quote-1.8.2.tgz"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/shell-quote_1.8.2_1732743217523_0.24614002980435967"},"_hasShrinkwrap":false,"readme":"# shell-quote <sup>[![Version Badge][npm-version-svg]][package-url]</sup>\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nParse and quote shell commands.\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## parse with custom escape character\n\n``` js\nvar parse = require('shell-quote/parse');\nvar xs = parse('beep ^--boop=\"$PWD\"', { PWD: '/home/robot' }, { escape: '^' });\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## parsing shell comment\n\n``` js\nvar parse = require('shell-quote/parse');\nvar xs = parse('beep > boop # > kaboom');\nconsole.dir(xs);\n```\n\noutput:\n\n```\n[ 'beep', { op: '>' }, 'boop', { comment: '> kaboom' } ]\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\n[package-url]: https://npmjs.org/package/shell-quote\n[npm-version-svg]: https://versionbadg.es/ljharb/shell-quote.svg\n[deps-svg]: https://david-dm.org/ljharb/shell-quote.svg\n[deps-url]: https://david-dm.org/ljharb/shell-quote\n[dev-deps-svg]: https://david-dm.org/ljharb/shell-quote/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/shell-quote#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/shell-quote.png?downloads=true&stars=true\n[license-image]: https://img.shields.io/npm/l/shell-quote.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/shell-quote.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=shell-quote\n[codecov-image]: https://codecov.io/gh/ljharb/shell-quote/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/shell-quote/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/shell-quote\n[actions-url]: https://github.com/ljharb/shell-quote/actions\n","publish_time":1732743217690,"maintainers":[{"name":"goto-bus-stop","email":"npm@asdf.kooi.me"},{"name":"karissa","email":"krmckelv@gmail.com"},{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"jiwaddell","email":"jacob.im.waddell@gmail.com"}],"_cnpm_publish_time":1732743217690,"dist-tags":{"latest":"1.12.0"}}