{"repo":"shelljs/shx","free":true,"listed":false,"github":"https://github.com/shelljs/shx","clone":"git clone https://github.com/shelljs/shx.git","description":"Portable Shell Commands for Node","language":"JavaScript","stars":1869,"topics":["shelljs","unix","bash"],"license":"MIT","category":"cli-tools","readme_excerpt":"Shx shx is a wrapper around ShellJS Unix commands, providing an easy solution for simple Unix-like, cross-platform commands in npm package scripts. shx is proudly tested on every LTS node release since v20 ! Difference Between ShellJS and shx - ShellJS: Good for writing long scripts, all in JS, running via NodeJS (e.g. node myScript.js ). - shx: Good for writing one-off commands in npm package scripts (e.g. \"clean\": \"shx rm -rf out/\" ). Install This will allow using shx in your package.json scripts. Usage Command Line If you'd like to use shx on the command line, install it globally with the -g flag. The following code can be run either a Unix or Windows command line: All commands internally call the ShellJS corresponding function, guaranteeing cross-platform compatibility. package.json ShellJS is good for writing long scripts. If you want to write bash-like, platform-independent scripts, we recommend you go with that. However, shx is ideal for one-liners inside package.json : It's safe to use && and operators in npm package scripts. These will be interpreted by the operating system's shell ( sh on Unix, cmd.exe on Windows). If you're using glob operators like or , then we recommend to put these in double quotes , which ensures that shx will expand the glob rather than the operating system shell. [!IMPORTANT] Windows treats single quotes (ex. 'some string' ) differently than double quotes. We recommend wrapping your arguments in escaped double quotes so that your code is comp","default_branch":null,"files":null,"tree":[],"storefront":"/r/shelljs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/shelljs/shx/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}