Socket
Socket
Sign inDemoInstall

web3-core-promievent

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-core-promievent - npm Package Compare versions

Comparing version 1.0.0-beta.37 to 1.0.0-beta.38

dist/web3-core-promievent.cjs.js

20

package.json
{
"name": "web3-core-promievent",
"namespace": "ethereum",
"version": "1.0.0-beta.37",
"version": "1.0.0-beta.38",
"description": "This package extends eventEmitters with promises to allow chaining as well as multiple final states of a function.",
"repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-core-promievent",
"license": "LGPL-3.0",
"main": "src/index.js",
"main": "dist/web3-core-promievent.cjs.js",
"module": "dist/web3-core-promievent.esm.js",
"browser": "dist/web3-core-promievent.umd.js",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"test": "jest",
"test:watch": "jest --watchAll"
},
"dependencies": {
"any-promise": "1.3.0",
"eventemitter3": "1.1.1"
}
"eventemitter3": "^3.1.0"
},
"files": [
"dist"
]
}

@@ -10,4 +10,2 @@ # web3-core-promievent

### Node.js
```bash

@@ -17,42 +15,15 @@ npm install web3-core-promievent

### In the Browser
Build running the following in the [web3.js][repo] repository:
```bash
npm run-script build-all
```
Then include `dist/web3-core-promievent.js` in your html file.
This will expose the `Web3PromiEvent` object on the window object.
## Usage
```js
// in node.js
var Web3PromiEvent = require('web3-core-promievent');
import PromiEvent from 'web3-core-promievent';
var myFunc = function(){
var promiEvent = Web3PromiEvent();
setTimeout(function() {
promiEvent.eventEmitter.emit('done', 'Hello!');
promiEvent.resolve('Hello!');
}, 10);
return promiEvent.eventEmitter;
};
new PromiEvent();
```
## Types
// and run it
myFunc()
.then(console.log);
.on('done', console.log);
```
All the typescript typings are placed in the types folder.
[docs]: http://web3js.readthedocs.io/en/1.0/
[repo]: https://github.com/ethereum/web3.js
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc