# injectpromise

> A simple Promise injector

Latest version **1.0.0** (published 2019-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install injectpromise
pnpm add injectpromise
yarn add injectpromise
bun add injectpromise
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-10-17 |
| First published | 2019-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/injectpromise) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sullof |

## Links

- npm: https://www.npmjs.com/package/injectpromise
- npm.io page: https://npm.io/package/injectpromise

## Recent versions

- 1.0.0 (latest) — 2019-10-17

## README

# injectpromise

A minimalistic package to insert a promise instead of using a callback.

### Usage

```javascript

const injectPromise = require('injectpromise')

class SomeClass {

    constructor() {
        this.injectPromise = injectPromise(this);
    }

    async getCurrent(callback = false) {

        if (!callback)
            return this.injectPromise(this.getCurrent);

        callSomething
            .then(result => {
            callback(null, result);
        }).catch(err => callback(err));
    }

}

module.exports = SomeClass


```

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