# promise-function

> Function always return promise

Latest version **0.0.12** (published 2015-10-28) · MIT license · 0 weekly downloads

## Install

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

## 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.12 |
| Published | 2015-10-28 |
| First published | 2015-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.1.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andrey Senaev |
| Maintainers | senaev |
| Keywords | promise, function |

## Links

- npm: https://www.npmjs.com/package/promise-function
- Repository: https://github.com/senaev/promise-function
- Homepage: http://github.com/senaev/promise-function
- Issues: https://github.com/senaev/promise-function/issues
- npm.io page: https://npm.io/package/promise-function

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

- 0.0.12 (latest) — 2015-10-28
- 0.0.11 — 2015-10-27
- 0.0.10 — 2015-10-27
- 0.0.9 — 2015-10-27
- 0.0.8 — 2015-10-27
- 0.0.7 — 2015-10-27
- 0.0.6 — 2015-10-27
- 0.0.5 — 2015-10-27
- 0.0.4 — 2015-09-22
- 0.0.3 — 2015-09-22
- 0.0.2 — 2015-09-22
- 0.0.1 — 2015-09-22

## README

## Installation

```bash
$ npm install promise-function
```

## Examples

  You can do: 

```js
var promiseFunc = require('promise-function');

promiseFunc(function(param) {
        return 'justReturn ok: ' + param;
    }, 'paramObject')
    .then(function(val) {
        console.log(val);
    })
    .catch(function(error) {
        console.error(error);
    });

promiseFunc(function(param) {
        return new Promise(function(resolve, reject) {
            setTimeout(function() {
                reject('returnPromiseReject ok: ' + param);
            }, 1000);
        });
    }, 'paramObject')
    .then(function(val) {
        console.log(val);
    })
    .catch(function(error) {
        console.error(error);
    });
    


promiseFunc(function(param) {
        var self = this;
        setTimeout(function() {
            self.resolve('callPromiseResolve ok: ' + param);
        }, 2000);
    }, 'paramObject')
    .then(function(val) {
        console.log(val);
    })
    .catch(function(error) {
        console.error(error);
    });
```

## License

  [MIT](LICENSE)

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