https://github.com/parro-it/px
Posix cross platform npm scripts.
https://github.com/parro-it/px
Last synced: 10 months ago
JSON representation
Posix cross platform npm scripts.
- Host: GitHub
- URL: https://github.com/parro-it/px
- Owner: parro-it
- License: mit
- Created: 2017-12-06T21:41:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T22:04:28.000Z (about 8 years ago)
- Last Synced: 2024-04-15T00:06:10.177Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 197 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
Posix cross platform npm scripts.
Write your npm scripts using posix bash syntax, cross platform
## Features
#### Command sequences
> _Execute a set of command serially_
```bash
command1; command2; command3;
```
#### Logical or
> _Execute commandB only if execution of commandA fail (exit code <> 0)_
```bash
command1 || command2
```
#### Logical and
> _Execute commandB only if execution of commandA succeed (exit code = 0)_
```bash
command1 && command2
```
#### Setting environment variables
> _Set an environment variable (could replace the use of cross-env)_
```bash
DEBUG=cmd cmd
```
#### Asynchronous execution of a process
> _Run cmd1, cmd2 and cmd3 in parallel_
```bash
cmd1 & cmd2 & cmd3
```
## Usage
1. Install `px`:
```bash
$ npm i @posix/px --save-dev
```
2. Add a line to your project `.npmrc` file to configure the script-shell config:
```
script-shell = "px"
```
**_on windows you shall use px.cmd:_**
```
px.cmd
```
> The setup process above will be automated using a `px --init` command.
## See Also
* [`noffle/common-readme`](https://github.com/noffle/common-readme)
* [`bash-parser`](https://github.com/vorpaljs/bash-parser)
## License
MIT - © 2017 Andrea Parodi