{"name":"event-target-shim","version":"6.0.0","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":{"@types/rimraf":"^3.0.0","domexception":"^2.0.1"},"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-commonjs":"^17.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-typescript":"^8.1.0","@types/domexception":"^2.0.1","@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","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` 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## 📚 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","_id":"event-target-shim@6.0.0","_nodeVersion":"15.2.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/5kZzzIjSdCo09kObw0T5rP5FyqMiUqIMj0utoRKzr7Qe7t39HCg5ieXfJO2pwTvbrf/0Y0hWeaol26pLkmT/g==","shasum":"dfadf7a372025d69353e32d2360ac47f8f0d4906","tarball":"http://registry-npm.ywwl.com/event-target-shim/download/event-target-shim-6.0.0.tgz","fileCount":15,"unpackedSize":369561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9WGtCRA9TVsSAnZWagAA9/AP/1ncMHK6fE16Q2ZuW5SF\nrLvoR2Ds3SLhp9iqloF97AlFLB0Kx1PUsZ+iK9YrsgetPKMwvspNO8BNZedX\nOKYuquz2TwCppjwQkaBCjmAP/S8ScoFGuclWWl1c8plCK6a5qUIzyXWuapMP\n3OOFGNqXmp73GDfBCsYdEP21gpNeTKJUOeVMmxSlqs6E4azA0oTpLX5f8IIm\nUF52CEHTJIn83m5+pWt5nua5dGjUKngiwhPeolDg0kDWCJ8b8MJaMKUL0XJQ\nFRMpaK4QGsozwR4Pej53hRhp7p1mm/BtQQCEHNXUoI9srGXswDIuh5A+h5QL\nPbsJ0KQ1dJsD4CFp340s7n8C023PO9kHC4HAcYrM3Iwie6WMdel/PRiP+qws\nNxEbu2QBSMDIwOH76JOyXfk6KXo4V2aE3wfNKENgqlC0Fh/MPk4NOKpjVa2J\nNgEG1R+2YrswWX9BJIkPRdX5ztrqB/vUMdMSzQ0wEQR5IoTSVD87QgKJBZv7\nHN8jblawc0ic83cw0HUmL3g3Y/BWKWyAPGDVNQPtL/g3nZ9f5pyURutkln6V\nvByggXfQWBtqx3b6rKK8iCOcf7SiK5VwTha+kdMAHejfN6GLiJ2RziOCrxAP\nHIfUUeuibYxTIJRCE5FreJPdXLnlYeUHAwY5vrFdB1Kk0VJsaAGB2aNurtcT\n75Kd\r\n=esPU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTr5vp7snlXwdUwIiDwGsPQXw8VcFWud+uXet1x12z0QIhAPhto7u2WvyndOq+AhOpM9SjUYuIHTrIA0mRuYrx3fEz"}],"size":73775,"noattachment":false,"key":"/event-target-shim/-/event-target-shim-6.0.0.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.0_1609916844648_0.03513029896207409"},"_hasShrinkwrap":false,"publish_time":1609916844847,"_cnpm_publish_time":1609916844847,"dist-tags":{"latest":"6.0.2"}}