An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          


px banner

Posix cross platform npm scripts.



Write your npm scripts using posix bash syntax, cross platform




travis ci



npm version



appveyor ci


## 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