{"name":"shx","version":"0.3.2","keywords":["shelljs","shell","unix","bash","sh","exec","cli","zsh"],"license":"MIT","_id":"shx@0.3.2","maintainers":[{"name":"freitagbr","email":"freitagbr@gmail.com"},{"name":"nfischer","email":"ntfschr@gmail.com"}],"contributors":[{"url":"http://ariporad.com/","name":"Ari Porad","email":"ari@ariporad.com"},{"url":"https://github.com/levithomason","name":"Levi Thomason","email":"me@levithomason.com"},{"name":"Nate Fischer","email":"ntfschr@gmail.com"}],"homepage":"https://github.com/shelljs/shx#readme","bugs":{"url":"https://github.com/shelljs/shx/issues"},"bin":{"shx":"lib/cli.js"},"dist":{"shasum":"40501ce14eb5e0cbcac7ddbd4b325563aad8c123","tarball":"http://registry-npm.ywwl.com/shx/download/shx-0.3.2.tgz","fileCount":10,"integrity":"sha512-aS0mWtW3T2sHAenrSrip2XGv39O9dXIFUqxAEWHEOS1ePtGIBavdPJY1kE2IHl14V/4iCbUiNDPGdyYTtmhSoA==","signatures":[{"sig":"MEQCIE8Ja1dWMPEEVwJzF4LX6RL7yjnYe8A7HXUC8pLQ00YSAiAhVRhdLBNl+Rz1UCFNuMeelCKu7F9cpaDuJdsm4g2kHA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":34108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbRYQCCRA9TVsSAnZWagAAPX4P/3gUCVkng6oKFiu2qmQV\nETeVOcM49g1YD5Lufc3K8kpoo4JrBc7pJcLIDk0riKfpShcQMvGizRp2BAHM\nFyqsXqo5GoC4Lo6j6ue2MSbiHoYTLTvfWF9lnp8otbvWuJKauqVOnEyKhRl/\niPSt0Fh+C0X9D7OlIk05MMpvFcXOJ6evTZF6tOil3MHme+gMzJjcEI7tEthh\ngbyCaMntvPj4w6MuujuYiYD6pMWE+Mjm4DuxJhTwIijTDs8m120jyuXDZ7WY\nBo8jD37PyRr7iTvX8Fd9cMIi7V9gy89Klc7mgpH/AUx7JTRAWOIk1mgqRSrx\nVtddpCD4UPZDH/dIGTqByO2Yab77hbWNfnnqw8EQSx7jyCzPnvWBP8oo67LX\nVBGbtL05v2NsAvvY560Q3mxNAqw5imDZ4dpTqsHYYTbSJFwhFGyKQqEPhDdp\nMsECl60ubvGDPiQEmdm/nT02lE7nONTJPJfV1p7eO633BCrnofEtuypd1swI\nK1zf8jAPQrjmIHH3XbWaMJI4OghloS5hoLa3geZb2FWNSuQ/uPdSa/1o1wVd\nlYJC/CR8gNzACaKkfQ7dzXjrlEM5xkZKlXtaUgKEvt6+/QymMawohj0jT694\ngEISfDFCqp1asA4isMeNMSChLLy+/B/opAtKv55di7mkAXusI97O/1Tatcm+\nij58\r\n=j/va\r\n-----END PGP SIGNATURE-----\r\n","size":10204,"noattachment":false,"key":"/shx/-/shx-0.3.2.tgz"},"files":["lib"],"engines":{"node":">=4"},"gitHead":"4ade36d43cf7545d7fcac2a6c248486a6a068c15","scripts":{"dev":"concurrently -rk 'npm run build:watch' 'npm run lint:watch'","lint":"eslint .","test":"nyc --reporter=text --reporter=lcov mocha","build":"babel src -d lib","codecov":"codecov","lint:fix":"npm run lint --silent -- --fix","posttest":"npm run lint --silent","prebuild":"rimraf lib","changelog":"shelljs-changelog","lint:watch":"watch 'npm run lint --silent' src test","prepublish":"npm run build","test:watch":"concurrently -rk 'npm run test --silent -- -w' 'npm run lint:watch'","build:watch":"npm run build -- -w","release:major":"shelljs-release major","release:minor":"shelljs-release minor","release:patch":"shelljs-release patch"},"_npmUser":{"name":"nfischer","email":"ntfschr@gmail.com"},"repository":{"url":"git+https://github.com/shelljs/shx.git","type":"git"},"_npmVersion":"5.5.1","description":"Portable Shell Commands for Node","directories":{},"_nodeVersion":"8.9.0","dependencies":{"shelljs":"^0.8.1","minimist":"^1.2.0","es6-object-assign":"^1.0.3"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^11.0.0","mocha":"^5.2.0","watch":"^0.18.0","eslint":"^2.10.1","rimraf":"^2.5.2","should":"^11.1.1","codecov":"^3.0.2","babel-cli":"^6.6.5","concurrently":"^2.1.0","babel-register":"^6.7.2","shelljs-release":"^0.3.0","babel-preset-env":"^1.7.0","shelljs-changelog":"^0.2.0","shelljs-plugin-open":"^0.2.0","eslint-plugin-import":"^1.8.0","eslint-config-airbnb-base":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/shx_0.3.2_1531282434194_0.2465678720806308","host":"s3://npm-registry-packages"},"readme":"# Shx\n\n[![GitHub Actions](https://img.shields.io/github/actions/workflow/status/shelljs/shx/main.yml?style=flat-square&logo=github)](https://github.com/shelljs/shx/actions/workflows/main.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/shelljs/shx/main.svg?style=flat-square&label=coverage)](https://codecov.io/gh/shelljs/shx)\n[![npm version](https://img.shields.io/npm/v/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)\n[![npm downloads](https://img.shields.io/npm/dm/shx.svg?style=flat-square)](https://www.npmjs.com/package/shx)\n\n`shx` is a wrapper around [ShellJS](https://github.com/shelljs/shelljs) Unix\ncommands, providing an easy solution for simple Unix-like, cross-platform\ncommands in npm package scripts.\n\n`shx` is proudly tested on every LTS node release since <!-- start minVersion -->`v18`<!-- stop minVersion -->!\n\n## Difference Between ShellJS and shx\n\n- **ShellJS:** Good for writing long scripts, all in JS, running via NodeJS (e.g. `node myScript.js`).\n- **shx:** Good for writing one-off commands in npm package scripts (e.g. `\"clean\": \"shx rm -rf out/\"`).\n\n## Install\n\n```shell\nnpm install shx --save-dev\n```\nThis will allow using `shx` in your `package.json` scripts.\n\n## Usage\n\n### Command Line\n\nIf you'd like to use `shx` on the command line, install it globally with the `-g` flag.\nThe following code can be run *either a Unix or Windows* command line:\n\n```Bash\n$ shx pwd                       # ShellJS commands are supported automatically\n/home/username/path/to/dir\n\n$ shx ls                        # files are outputted one per line\nfile.txt\nfile2.txt\n\n$ shx rm *.txt                  # a cross-platform way to delete files!\n\n$ shx ls\n\n$ shx echo \"Hi there!\"\nHi there!\n\n$ shx touch helloworld.txt\n\n$ shx cp helloworld.txt foobar.txt\n\n$ shx mkdir sub\n\n$ shx ls\nfoobar.txt\nhelloworld.txt\nsub\n\n$ shx rm -r sub                 # options work as well\n\n$ shx --silent ls fakeFileName  # silence error output\n\n$ shx --negate test -d dir      # Negate status code output (e.g., failed commands will now have status 0)\n```\n\nAll commands internally call the ShellJS corresponding function, guaranteeing\ncross-platform compatibility.\n\n### package.json\n\nShellJS is good for writing long scripts. If you want to write bash-like,\nplatform-independent scripts, we recommend you go with that.\n\nHowever, `shx` is ideal for one-liners inside `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"clean\": \"shx rm -rf \\\"build/**/*.js\\\" \\\"build/output\\\" && shx echo \\\"Done cleaning\\\"\"\n  }\n}\n```\n\nIt's safe to use `&&` and `||` operators in npm package scripts. These will be\ninterpreted by the operating system's shell (`sh` on Unix, `cmd.exe` on\nWindows). If you're using glob operators like `*` or `**`, then we recommend to\n**put these in double quotes**, which ensures that `shx` will expand the glob\nrather than the operating system shell.\n\n> [!IMPORTANT]\n> Windows treats single quotes (ex. `'some string'`) differently than double\n> quotes.\n> [We recommend](https://github.com/shelljs/shx/issues/165#issuecomment-563127983)\n> wrapping your arguments in **escaped double quotes** so that your code is\n> compatible cross platform (ex. `\"clean\": \"shx echo \\\"some string\\\"\"`).\n\n## Command reference\n\nShx exposes [most ShellJS\ncommands](https://github.com/shelljs/shelljs#command-reference). If a command is\nnot listed here, assume it's supported!\n\n### sed\n\nShx provides unix-like syntax on top of `shell.sed()`. So ShellJS code like:\n\n```js\nshell.sed('-i', /original string/g, 'replacement', 'filename.txt');\n```\n\nwould turn into the following Shx command:\n\n```sh\nshx sed -i \"s/original string/replacement/g\" filename.txt\n```\n\n**Note:** like unix `sed`, `shx sed` treats `/` as a special character, and\n[this must be\nescaped](https://github.com/shelljs/shx/issues/169#issuecomment-563013849) (as\n`\\/` in the shell, or `\\\\/` in `package.json`) if you intend to use this\ncharacter in either the regex or replacement string. Do **not** escape `/`\ncharacters in the file path.\n\n### Unsupported Commands\n\nAs mentioned above, most ShellJS commands are supported in `shx`. Due to the\ndifferences in execution environments between ShellJS and `shx` (JS vs CLI) the\nfollowing commands are not supported:\n\n| Unsupported command | Recommend workaround |\n| ------------------- | -------------------- |\n| `shx cd`            | Just use plain old `cd` (it's the same on windows too) |\n| `shx pushd`         | Just use plain old `pushd`. Use forward slashes and double-quote the path. (e.g. `pushd \"../docs\"`. This would fail on Windows without the quotes) |\n| `shx popd`          | Just use plain old `popd` |\n| `shx dirs`          | No workaround |\n| `shx set`           | See below |\n| `shx exit`          | Just use plain old `exit` |\n| `shx exec`          | Instead of `shx exec cmd`, just use plain old `cmd` |\n| `shx ShellString`   | No workaround (but why would you want this?) |\n\n### Shx options\n\nShx allows you to modify its behavior by passing arguments. Here's a list of\nsupported options:\n\n| [`set`](https://github.com/shelljs/shelljs#setoptions) flag | [`shell.config`](https://github.com/shelljs/shelljs#configuration) setting | shx command | Effect |\n|:---:| --- | --- | --- |\n| `-e` | `config.fatal = true` | Not supported | Exit upon first error. |\n| `-v` | `config.verbose = true` | `shx --verbose cd foo` | Log the command as it's run. |\n| `-f` | `config.noglob = true` | `shx --noglob cat '*.txt'` | Don't expand wildcards. |\n| N/A | `config.silent = true` | `shx --silent cd noexist` | Don't show error output. |\n| N/A | N/A | `shx --negate test -d dir` | Runs the specified command but negates the exit status. Failed command = status 0, successful command = status 1. |\n| N/A | N/A | `shx --help` | Show help text. |\n| N/A | N/A | `shx --version` | Print the shx version. |\n\n## Team\n\n| [![Nate Fischer](https://avatars.githubusercontent.com/u/5801521?s=130)](https://github.com/nfischer) | [![Ari Porad](https://avatars1.githubusercontent.com/u/1817508?v=3&s=130)](http://github.com/ariporad) | [![Levi Thomason](https://avatars1.githubusercontent.com/u/5067638?v=3&s=130)](https://github.com/levithomason) |\n|:---:|:---:|:---:|\n| [Nate Fischer](https://github.com/nfischer) | [Ari Porad](http://github.com/ariporad) | [Levi Thomason](https://github.com/levithomason) |\n","publish_time":1531282434318,"_cnpm_publish_time":1531282434318,"dist-tags":{"latest":"0.4.0"}}