web3-core-promievent
Advanced tools
Comparing version 1.0.0-beta.37 to 1.0.0-beta.38
{ | ||
"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 | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
13060
1
7
127
28
2
+ Addedeventemitter3@3.1.2(transitive)
- Removedany-promise@1.3.0
- Removedany-promise@1.3.0(transitive)
- Removedeventemitter3@1.1.1(transitive)
Updatedeventemitter3@^3.1.0