# web3-core-promievent

> This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.

Latest version **1.10.3** (published 2023-10-18) · LGPL-3.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities; popular repo.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.10.3 |
| Published | 2023-10-18 |
| First published | 2017-07-24 |
| Weekly downloads | 0 |
| License | LGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19912 |
| Maintainers | luu-alex, mpetrunic, jdevcs, gregthegreek |

## Links

- npm: https://www.npmjs.com/package/web3-core-promievent
- Repository: https://github.com/ethereum/web3.js.git#1.x
- Homepage: https://github.com/ethereum/web3.js/tree/1.x#readme
- Issues: https://github.com/ethereum/web3.js/issues
- npm.io page: https://npm.io/package/web3-core-promievent

## Dependencies (1)

- [eventemitter3](https://npm.io/package/eventemitter3.md) 4.0.4

## Recent versions

- 1.10.3 (latest) — 2023-10-18
- 1.10.4 (legacy) — 2024-02-05
- 1.10.4-dev.0 (legacy-dev) — 2024-01-31
- 1.10.1-rc.0 (rc-legacy) — 2023-08-08
- 1.10.0-rc.0 (rc) — 2023-05-02
- 1.10.3-dev.0 — 2023-10-16
- 1.10.2 — 2023-08-28
- 1.10.1 — 2023-08-14
- 1.10.0 — 2023-05-10
- 1.9.0 — 2023-03-20
- 1.9.0-rc.0 — 2023-03-07
- 1.8.2 — 2023-01-30
- 1.8.2-rc.0 — 2023-01-11
- 1.8.1 — 2022-11-10
- 1.8.1-rc.0 — 2022-10-28
- … 109 more at https://npm.io/package/web3-core-promievent/versions

## README

# web3-core-promievent

[![NPM Package][npm-image]][npm-url]

This is a sub-package of [web3.js][repo].

This is the PromiEvent package 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

You can install the package either using [NPM](https://www.npmjs.com/package/web3-core-promievent) or using [Yarn](https://yarnpkg.com/package/web3-core-promievent)

### Using NPM

```bash
npm install web3-core-promievent
```

### Using Yarn

```bash
yarn add web3-core-promievent
```

## Usage

```js
const Web3PromiEvent = require('web3-core-promievent');

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

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

[docs]: http://web3js.readthedocs.io/en/1.0/
[repo]: https://github.com/ethereum/web3.js
[npm-image]: https://img.shields.io/npm/v/web3-core-promievent.svg
[npm-url]: https://npmjs.org/package/web3-core-promievent

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