# node-promise-process

> Running an array of processes or functions async after each other

Latest version **2.0.1** (published 2021-01-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-promise-process
pnpm add node-promise-process
yarn add node-promise-process
bun add node-promise-process
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-01-01 |
| First published | 2021-01-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 28 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Tomlin |
| Maintainers | inspiraller |
| Keywords | node-promise-process |

## Links

- npm: https://www.npmjs.com/package/node-promise-process
- Repository: https://github.com/inspiraller/node-promise-process
- Homepage: https://github.com/inspiraller/node-promise-process#readme
- Issues: https://github.com/inspiraller/node-promise-process/issues
- npm.io page: https://npm.io/package/node-promise-process

## Dependencies (18)

- [eslint](https://npm.io/package/eslint.md) ^6.8.0
- [nodemon](https://npm.io/package/nodemon.md) ^1.18.4
- [prettier](https://npm.io/package/prettier.md) ^1.19.1
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.2
- [babel-jest](https://npm.io/package/babel-jest.md) ^26.3.0
- [typescript](https://npm.io/package/typescript.md) ^4.1.3
- [babel-eslint](https://npm.io/package/babel-eslint.md) ^10.1.0
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.1.0
- [eslint-loader](https://npm.io/package/eslint-loader.md) ^4.0.2
- [eslint-plugin-jest](https://npm.io/package/eslint-plugin-jest.md) ^23.18.2
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) ^18.0.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.22.1
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^6.9.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.2
- [babel-plugin-module-resolver](https://npm.io/package/babel-plugin-module-resolver.md) ^4.0.0
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^9.0.0
- [babel-plugin-transform-redom-jsx](https://npm.io/package/babel-plugin-transform-redom-jsx.md) ^3.0.1
- [eslint-import-resolver-babel-module](https://npm.io/package/eslint-import-resolver-babel-module.md) ^5.1.2

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2021-01-01
- 2.0.0 — 2021-01-01
- 1.0.5 — 2021-01-01
- 1.0.4 — 2021-01-01
- 1.0.3 — 2021-01-01
- 1.0.2 — 2021-01-01
- 1.0.1 — 2021-01-01
- 1.0.0 — 2021-01-01

## README

# Prerequisites:

- node
- npm
- yarn optional

# Download this repo

```
git clone https://github.com/inspiraller/node-promise-process.git
```

# cd into folder

```
cd node-promise-process
```

# install dependencies

```
yarn install
```

or

```
npm install
```

# Create your example

**myprocess.js**
```javascript
const sync = require('node-promise-process').default;

const helloworld = () => 'hello world';

const init = async () => {
  await sync([
    helloworld,
    'mkdir steve'
  ]);
};

init();
```

# run

```
node myprocess.js
```

# How to test as typescript version
- prerequisites - will need dependencies

**package.json - script**
```javascript
"scripts": {
  "example-process": "cross-env-shell babel-node --extensions '.ts,.tsx' src/example-process.ts"
},
```
**example-process.ts**
```typescript
import sync, {TcmdOrFunc} from 'node-promise-process';

const hello1 = () => {
  console.log('hello world!');
  return 'hello - success'; // need to return something... handleFunc is expecting a string result.
};
const hello2 = hello1;

const init = async () => {
  const arrNext: TcmdOrFunc[] = [
    hello1,
    hello2,
    'mkdir steve'
  ];
  await sync(arrNext);
};
init();
```

Done !

---
_Source: https://npm.io/package/node-promise-process · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
