# app3-core-promievent

> This package extends eventEmitters with promises to allow chaining as well as multiple final states of a function.

Latest version **0.9.3-1** (published 2018-11-15) · LGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install app3-core-promievent
pnpm add app3-core-promievent
yarn add app3-core-promievent
bun add app3-core-promievent
```

## 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.9.3-1 |
| Published | 2018-11-15 |
| First published | 2018-11-15 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | apisplatform |

## Links

- npm: https://www.npmjs.com/package/app3-core-promievent
- Repository: https://github.com/APIS-Platform/app3.js
- Homepage: https://apisplatform.io
- Issues: https://github.com/APIS-Platform/app3.js/issues
- npm.io page: https://npm.io/package/app3-core-promievent

## Dependencies (2)

- [any-promise](https://npm.io/package/any-promise.md) 1.3.0
- [eventemitter3](https://npm.io/package/eventemitter3.md) 1.1.1

## Recent versions

- 0.9.3-1 (latest) — 2018-11-15
- 0.9.3 — 2018-11-15

## README

# app3-core-promievent

This is a sub package of [app3.js][repo]

This is the PromiEvent package is used to return a EventEmitter mixed with a Promise to allow multiple final states as well as chaining.
Please read the [documentation][docs] for more.

## Installation

### Node.js

```bash
npm install app3-core-promievent
```

### In the Browser

Build running the following in the [app3.js][repo] repository:

```bash
npm run-script build-all
```

Then include `dist/app3-core-promievent.js` in your html file.
This will expose the `App3PromiEvent` object on the window object.


## Usage

```js
// in node.js
var App3PromiEvent = require('app3-core-promievent');

var myFunc = function(){
    var promiEvent = App3PromiEvent();
    
    setTimeout(function() {
        promiEvent.eventEmitter.emit('done', 'Hello!');
        promiEvent.resolve('Hello!');
    }, 10);
    
    return promiEvent.eventEmitter;
};


// and run it
myFunc()
.then(console.log);
.on('done', console.log);
```


[docs]: https://app3js.readthedocs.io/en/latest
[repo]: https://github.com/APIS-Platform/app3.js

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