{"name":"shx","version":"0.3.3","keywords":["shelljs","shell","unix","bash","sh","exec","cli","zsh"],"license":"MIT","_id":"shx@0.3.3","maintainers":[{"name":"nfischer","email":"ntfschr@gmail.com"},{"name":"freitagbr","email":"freitagbr@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":"681a88c7c10db15abe18525349ed474f0f1e7b9f","tarball":"http://registry-npm.ywwl.com/shx/download/shx-0.3.3.tgz","fileCount":10,"integrity":"sha512-nZJ3HFWVoTSyyB+evEKjJ1STiixGztlqwKLTUNV5KqMWtGey9fTd4KU1gdZ1X9BV6215pswQ/Jew9NsuS/fNDA==","signatures":[{"sig":"MEYCIQCwjRl0wqSZg86OS5BZO3Ofgmb04xX95dEHd1JJ80BacAIhANNh5H2qB1yJStJtgnq8LYcMalEfQLtmHe6OTcoMFcpZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJflmATCRA9TVsSAnZWagAA0hgP+gPYTIuu/W8hId1lVI2Q\n/S/iyh8vZVESvtrIXPmSWPKMkj+ZjYfdxx+2qsF8XARyVbmtyO8jvohGoJGA\nwkFiTAkNDKVWSWpl2yswEQqR5EpayvGcRr3LeSfcaOxQKRwYFZNm9CKyOd/M\nk3z3F1rwv86OEDrfw8/wVprQ5w6fjFLlnFyLVTIQLfb1cQQioj8epXcPr6Ek\nmhRqav+AHS4vKVBz0oj+T9wXPkiLo61miycqoMxP5QHEjd1iN+RcB9ufixXI\nuTkEg8YP2gLKzkRfUSTt64h2DH00RRDQOQh2mUAaj3d8kwMScnocnE8tuNd4\npfLOO4TevQ6RfRf4fR51ufDshrXUjNLy5nV2tCmp1i4SIzFfHqYjL8LrW/Z+\nXrEZKJ6uau/MIHSKzN9aMPfq4IhIz0S+YObjSn6Dk3Glay+W9nn6WhBbSWuL\nfOSil3n7tYeqgD29LWIXwQPiaBvooRuj263QZeJNwZ01PUe3aXc6Pz8mWcyI\nb79f3haxfY1f3eLnMjXFUpPFbmJF0N2dRj+Oy41WGr0rRvRnmpxvzvSWiAyy\n/O4TRAybqGKyWP29ripyihTBzmcTfuQPo62H9QNrzdaUgx4L1kGRzBGQFEFz\nRbOcqotyI2UlbGefbEJJUE/tkW/Jzd8SSQNBMsasZ2MhIP+GjzUCoVJ9/UiJ\nwxnb\r\n=mzXn\r\n-----END PGP SIGNATURE-----\r\n","size":10684,"noattachment":false,"key":"/shx/-/shx-0.3.3.tgz"},"engines":{"node":">=6"},"gitHead":"6d2d2f21753de01c10cc5bdaefb2f032bfe7f66d","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","check-node-support":"node scripts/check-node-support"},"_npmUser":{"name":"nfischer","email":"ntfschr@gmail.com"},"repository":{"url":"git+https://github.com/shelljs/shx.git","type":"git"},"_npmVersion":"6.14.4","description":"Portable Shell Commands for Node","directories":{},"_nodeVersion":"10.19.0","dependencies":{"shelljs":"^0.8.4","minimist":"^1.2.3"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^14.1.1","mocha":"^6.1.4","watch":"^1.0.2","eslint":"^5.16.0","rimraf":"^2.5.2","should":"^13.2.3","codecov":"^3.0.2","js-yaml":"^3.12.0","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":"^2.17.3","eslint-config-airbnb-base":"^13.1.0"},"_npmOperationalInternal":{"tmp":"tmp/shx_0.3.3_1603690514825_0.6728869112127944","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":1603690514984,"_cnpm_publish_time":1603690514984,"dist-tags":{"latest":"0.4.0"}}