# promise-pls

> Return an initialised promise, along with its resolve & reject methods

Latest version **0.0.1** (published 2018-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-pls
pnpm add promise-pls
yarn add promise-pls
bun add promise-pls
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-01-18 |
| First published | 2018-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Hall |
| Maintainers | bhallstein |
| Keywords | js, es6, promise |

## Links

- npm: https://www.npmjs.com/package/promise-pls
- Repository: https://github.com/bhallstein/promise-pls
- Issues: https://github.com/bhallstein/promise-pls/issues
- npm.io page: https://npm.io/package/promise-pls

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.1 (latest) — 2018-01-18

## README

# promise-pls.js

Return an initialised promise, along with its resolve & reject methods.

## Install:

`npm i promise-pls`


## Usage:

```js
import promise_pls from 'promise-pls';

function do_something() {
  let { p, y, n } = promise_pls();

  function cb(error) {
    if (error) {
      n(error);
    }
    else {
      y();
    }
  }

  run_task(cb);

  return p;
}

do_something()
  .then(function() {
    console.log('done!');
  })
  .catch(functoin(error) {
    console.log('error:', error);
  });
```


## Without promise-pls:

```js
let [y, n];
let p = new Promise(function(_y, _n) {
  [y, n] = [_y, _n];
});
```

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