{"name":"event-target-shim","version":"6.0.1","description":"An implementation of WHATWG EventTarget interface.","main":"index.js","exports":{".":{"import":"./index.mjs","require":"./index.js"},"./es5":{"import":"./es5.mjs","require":"./es5.js"},"./umd":"./umd.js","./package.json":"./package.json"},"engines":{"node":">=10.13.0"},"scripts":{"build":"run-s \"build:{clean,rollup,dts,meta}\"","build:clean":"rimraf \"dist/*\"","build:rollup":"rollup --config scripts/rollup.config.js","build:dts":"dts-bundle-generator --project tsconfig/dts.json --out-file dist/index.d.ts src/index.ts && dts-bundle-generator --project tsconfig/dts.json --out-file dist/es5.d.ts src/index.ts","build:meta":"cpx \"{LICENSE,package.json,README.md}\" dist/","preversion":"npm test","version":"npm run build","postversion":"release","test":"run-s \"test:{clean,tsc,lint,format,mocha}\"","test:clean":"rimraf \"coverage/*\"","test:tsc":"tsc -p tsconfig/build.json --noEmit","test:lint":"eslint .","test:format":"prettier --check .","test:mocha":"ts-node scripts/test","watch:mocha":"mocha --require ts-node/register/transpile-only --extensions ts --watch-files src,test --watch \"test/*.ts\""},"dependencies":{},"devDependencies":{"@babel/core":"^7.12.10","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.11","@mysticatea/eslint-plugin":"^13.0.0","@mysticatea/spy":"^0.1.2","@mysticatea/tools":"^0.1.1","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-typescript":"^8.1.0","@types/istanbul-lib-coverage":"^2.0.3","@types/istanbul-lib-report":"^3.0.0","@types/istanbul-lib-source-maps":"^4.0.1","@types/istanbul-reports":"^3.0.0","@types/mocha":"^8.2.0","@types/rimraf":"^3.0.0","assert":"^2.0.0","babel-loader":"^8.2.2","babel-plugin-istanbul":"^6.0.0","buffer":"^6.0.3","chalk":"^4.1.0","codecov":"^3.8.1","cpx":"^1.5.0","dts-bundle-generator":"^5.5.0","eslint":"^7.15.0","istanbul-lib-coverage":"^3.0.0","istanbul-lib-report":"^3.0.0","istanbul-lib-source-maps":"^4.0.0","istanbul-reports":"^3.0.2","mocha":"^7.2.0","npm-run-all":"^4.1.5","path-browserify":"^1.0.1","playwright":"^1.7.0","prettier":"~2.2.1","process":"^0.11.10","rimraf":"^3.0.2","rollup":"^2.35.1","rollup-plugin-terser":"^7.0.2","rollup-watch":"^4.3.1","stream-browserify":"^3.0.0","ts-loader":"^8.0.12","ts-node":"^9.1.1","tslib":"^2.0.3","typescript":"~4.1.3","url":"^0.11.0","util":"^0.12.3","webpack":"^5.11.0"},"repository":{"type":"git","url":"git+https://github.com/mysticatea/event-target-shim.git"},"keywords":["w3c","whatwg","eventtarget","event","events","shim"],"author":{"name":"Toru Nagashima"},"license":"MIT","bugs":{"url":"https://github.com/mysticatea/event-target-shim/issues"},"homepage":"https://github.com/mysticatea/event-target-shim","funding":"https://github.com/sponsors/mysticatea","sideEffects":false,"unpkg":"umd.js","readme":"# event-target-shim\n\n[![npm version](https://img.shields.io/npm/v/event-target-shim.svg)](https://www.npmjs.com/package/event-target-shim)\n[![Downloads/month](https://img.shields.io/npm/dm/event-target-shim.svg)](http://www.npmtrends.com/event-target-shim)\n[![Build Status](https://github.com/mysticatea/event-target-shim/workflows/CI/badge.svg)](https://github.com/mysticatea/event-target-shim/actions)\n[![Coverage Status](https://codecov.io/gh/mysticatea/event-target-shim/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/event-target-shim)\n[![Dependency Status](https://david-dm.org/mysticatea/event-target-shim.svg)](https://david-dm.org/mysticatea/event-target-shim)\n\nAn implementation of [WHATWG `EventTarget` interface](https://dom.spec.whatwg.org/#interface-eventtarget) and [WHATWG `Event` interface](https://dom.spec.whatwg.org/#interface-event). This implementation supports constructor, `passive`, `once`, and `signal`.\n\nThis implementation is designed ...\n\n- Working fine on both browsers and Node.js.\n- TypeScript friendly.\n\n## 💿 Installation\n\nUse [npm](https://www.npmjs.com/) or a compatible tool.\n\n```\nnpm install event-target-shim\n```\n\n## 📖 Getting started\n\n```js\nimport { EventTarget, Event } from \"event-target-shim\";\n\n// constructor (was added to the standard on 8 Jul 2017)\nconst myNode = new EventTarget();\n\n// passive flag (was added to the standard on 6 Jan 2016)\nmyNode.addEventListener(\n  \"hello\",\n  (e) => {\n    e.preventDefault(); // ignored and print warning on console.\n  },\n  { passive: true }\n);\n\n// once flag (was added to the standard on 15 Apr 2016)\nmyNode.addEventListener(\"hello\", listener, { once: true });\nmyNode.dispatchEvent(new Event(\"hello\")); // remove the listener after call.\n\n// signal (was added to the standard on 4 Dec 2020)\nconst ac = new AbortController();\nmyNode.addEventListener(\"hello\", listener, { signal: ac.signal });\nac.abort(); // remove the listener.\n```\n\n- For browsers, use a bundler such as [Webpack](https://webpack.js.org/) to bundle.\n  - If you want to support IE11, use `import {} from \"event-target-shim/es5\"` instead. It's a transpiled code by babel. It depends on `@baebl/runtime` (`^7.12.0`) package.\n- The `AbortController` class was added to the standard on 14 Jul 2017. If you want the shim of that, use [abort-controller](https://www.npmjs.com/package/abort-controller) package.\n\n### Runnable Examples\n\n- [Basic Example](https://jsbin.com/dapuwomamo/edit?html,console)\n- [Basic Example (IE11)](https://jsbin.com/fumuhepike/edit?html,console)\n\n## 📚 API Reference\n\nSee [docs/reference.md](docs/reference.md).\n\n## 💥 Migrating to v6\n\nSee [docs/migrating-to-v6.md](docs/migrating-to-v6.md).\n\n## 📰 Changelog\n\nSee [GitHub releases](https://github.com/mysticatea/event-target-shim/releases).\n\n## 🍻 Contributing\n\nContributing is welcome ❤️\n\nPlease use GitHub issues/PRs.\n\n### Development tools\n\n- `npm install` installs dependencies for development.\n- `npm test` runs tests and measures code coverage.\n- `npm run watch:mocha` runs tests on each file change.\n","readmeFilename":"README.md","gitHead":"41c25b27495ac79e5183784e8cc39282046b58d9","_id":"event-target-shim@6.0.1","_nodeVersion":"15.2.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-M2uk7FC/FANvg2PFEiAuQNpdLDWK0kq9mac94HOnAfa37N3yM7PvcNlRrQWYx6qmXq/lc0e22HkEWKYsr6NWYg==","shasum":"548f1f2a25b165d92594335a2ec71dfe4cae52d6","tarball":"http://registry-npm.ywwl.com/event-target-shim/download/event-target-shim-6.0.1.tgz","fileCount":3,"unpackedSize":7584,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9sC1CRA9TVsSAnZWagAADrAP/3H1a29Z5hKgArA2b6/J\nxdjy+zxmqXb8cqZcutKoOWdislrfm1UIGR5wehkHSlu3zpY2ndt8zLPXWq0a\ngWxCnaeThiARMoISxCLKA6g/sPdoIfjsr1usHq0owJ5ayI6kjiLp63YjPUkm\nKnND3VcffeXWVp3FYsySqWiRfnvrrYtPyjzoxWw0dqT+bGp4Q3N0MgwBL2GE\nXIRBTvcf9UiMCKgYCYjd/7uhYSTUKbImOhpp9WU3YV+0q4gd0LALOeLcQhwy\ncFfLVJFmF5E+lfiId67T5N9DZ9k/2C6MfjoGq/oUS6vIakLUIEB/AwKXpi5+\nf2SttC0Y32dTd3N6VbLsWEYb9ZUBaFtoz7xB4W8ok4GdF15NPUiim2+kJ9q4\nNX9aUNv32t6g1+FIgHy3ceI71Mf6NsIKWMcEfbII79Swrn5Dorfg0oUk36Fh\nuvzRTA9BFLp44fOZq7rc28tvNvRQzq+cn1vTPWG9Yiz/xku7kPVE0vrQWWpa\nHmB+wdZ5lUUrfk7+4ZPdv59mh1RXG83+PkiiUmH12/9Sq2Sp+WUEMT9wCx02\n8cGdfUaR294gTInehw3bW8+z7BE9w8JSn0FXBEm7EtcLJkb9m3ikA1bnTbcd\n6pLen9tCBf2cEVpwK/CwXI0R9xCJiKCEfFQbck1rmr1lW98DAKtqYUF0Y/6V\nwEv8\r\n=oVaj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGlGtFoyIW8dLz5NCOpOIig2J1b2KNIMGwqvCHBwPmtPAiA5LEc82XIBdf6JY8BEHUSLvJzB6CvFe2uDCaA4rKde4w=="}],"size":3161,"noattachment":false,"key":"/event-target-shim/-/event-target-shim-6.0.1.tgz"},"_npmUser":{"name":"mysticatea","email":"public@mysticatea.dev"},"directories":{},"maintainers":[{"name":"mysticatea","email":"public@mysticatea.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/event-target-shim_6.0.1_1610006708676_0.41435068543167874"},"_hasShrinkwrap":false,"publish_time":1610006708800,"_cnpm_publish_time":1610006708800,"dist-tags":{"latest":"6.0.2"}}