# susyweb-core-promievent

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

Latest version **1.0.0-beta.35** (published 2019-06-20) · LGPL-3.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.35 |
| Published | 2019-06-20 |
| First published | 2019-06-20 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | superstring |

## Links

- npm: https://www.npmjs.com/package/susyweb-core-promievent
- Repository: https://octonion.institute/susy-js/susyweb.js/tree/master/packages/susyweb-core-promievent
- npm.io page: https://npm.io/package/susyweb-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

- 1.0.0-beta.35 (latest) — 2019-06-20
- 1.0.0-beta.37 — 2019-06-20

## README

# susyweb-core-promievent

This is a sub package of [susyweb.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 susyweb-core-promievent
```

### In the Browser

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

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

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


## Usage

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

var myFunc = function(){
    var promiEvent = SusyWebPromiEvent();
    
    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]: http://susywebjs.readthedocs.io/en/1.0/
[repo]: https://octonion.institute/susy-js/susyweb.js

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