{"_id":"@alayanetwork/web3-core-promievent","_rev":"1-dc0be8a1be4d8f650a9de861cffbd2f9","name":"@alayanetwork/web3-core-promievent","dist-tags":{"latest":"0.13.2"},"versions":{"0.13.2":{"name":"@alayanetwork/web3-core-promievent","version":"0.13.2","description":"This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.","repository":{"type":"git","url":"https://github.com/PlatONnetwork/client-sdk-js/tree/feature/alaya-dev/web3-core-promievent"},"license":"LGPL-3.0","engines":{"node":">=8.0.0"},"main":"src/index.js","dependencies":{"any-promise":"1.3.0","eventemitter3":"3.1.2"},"_id":"@alayanetwork/web3-core-promievent@0.13.2","_nodeVersion":"14.12.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mlh5HVxSfFXlnlUgFqRd64NTtD0DwKAdTYFU2yM5m/0HW1vwDDT/Ij3J+8mfS2i3JfF9nhW65E6vjcaesPzHpw==","shasum":"0c23f3825d8c68da5643a92fdd38500916158020","tarball":"https://registry.npmjs.org/@alayanetwork/web3-core-promievent/-/web3-core-promievent-0.13.2.tgz","fileCount":3,"unpackedSize":3763,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjpKzCRA9TVsSAnZWagAAnaAP/1AksGHFJ2JI4Q3bdr5Q\nEoABh8CJoYING6rHxpb70nCzV5CocNkXch56j/uQJO8fDoGAZDasOPeprbkw\nbUhz4MwK3xc89PokQlr/gporc5lIzm8lhXWzuysnBBfuPjJhuuYph2LbUZ5H\ndt7fNNBwHJcW47QmvKGo3bvzDfggPfqpz4IaRaPv0aP/uhOmjwy1K9zz/rL/\nhagG+rNc1ec9NxVRHB422LfasH8OGwgDtKFLoisy9x80Px/KhLDFZqw8p76d\n8/3RZYhDHEKVHhIU+cBo5X/Q2Fb4dIcXZFUnS8IXWarKxaG+dE2Gc8oUsVTd\nz8ZMED+fn/k01xCTpVexvS0+Rjv8uw6uAg7NeKmxlrk2iWvZzqdi+NY0WtxC\n07oiT5ZC//RGSGE1uksFCvA/1CxA+RPlhiXQKmM9mO2xdP/WiDhu62YG57WP\n5jnpBUxc8uevHEtp14W4E+pTRUIrsGzRpCAinI7Hry+J7SIxiyWFWavGWVZI\nRXnyyFx28e4EoxElLwRs9NbXUSKAARGjkP3c3ic+QMZCPq5OHUTXY9+cU0Q7\n7BxKBvCtA3ZTYgkAYcYb2K+RJoQ5OWCZzia8cXH6fwJdABT9Bn+Qrf+JmrAY\nSgUqA3Ldqhj3ltrN/33OWn5nyKUMHmRUloo360aEX9NzkZ/1Brj27YKTFASr\nQ5ZP\r\n=klMJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE92DUylT6rhJeSE+4agScdkAvCBstC0Htcbrd0zlY2oAiEA4aOgzUl+R8FwAEox1lY3u1lgbvhuGS85dn6xyzAp6BE="}]},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"_npmUser":{"name":"alayanetwork","email":"npm@latticex.foundation"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web3-core-promievent_0.13.2_1603179187344_0.8440703427872815"},"_hasShrinkwrap":false}},"time":{"created":"2020-10-20T07:33:07.295Z","0.13.2":"2020-10-20T07:33:07.480Z","modified":"2022-04-04T12:34:00.405Z"},"maintainers":[{"name":"alayanetwork","email":"npm@latticex.foundation"}],"description":"This package extends the EventEmitter with the Promise class to allow chaining as well as multiple final states of a function.","repository":{"type":"git","url":"https://github.com/PlatONnetwork/client-sdk-js/tree/feature/alaya-dev/web3-core-promievent"},"license":"LGPL-3.0","readme":"# web3-core-promievent\n\nThis is a sub package of [web3.js][repo]\n\nThis is the PromiEvent package is used to return a EventEmitter mixed with a Promise to allow multiple final states as well as chaining.\nPlease read the [documentation][docs] for more.\n\n## Installation\n\n### Node.js\n\n```bash\nnpm install web3-core-promievent\n```\n\n### In the Browser\n\nBuild running the following in the [web3.js][repo] repository:\n\n```bash\nnpm run-script build-all\n```\n\nThen include `dist/web3-core-promievent.js` in your html file.\nThis will expose the `Web3PromiEvent` object on the window object.\n\n\n## Usage\n\n```js\n// in node.js\nvar Web3PromiEvent = require('web3-core-promievent');\n\nvar myFunc = function(){\n    var promiEvent = Web3PromiEvent();\n    \n    setTimeout(function() {\n        promiEvent.eventEmitter.emit('done', 'Hello!');\n        promiEvent.resolve('Hello!');\n    }, 10);\n    \n    return promiEvent.eventEmitter;\n};\n\n\n// and run it\nmyFunc()\n.then(console.log);\n.on('done', console.log);\n```\n\n\n[docs]: http://web3js.readthedocs.io/en/1.0/\n[repo]: https://github.com/ethereum/web3.js\n\n\n","readmeFilename":"README.md"}