{"name":"yaeti","version":"1.0.2","description":"Yet Another EventTarget Implementation","author":{"name":"Iñaki Baz Castillo","email":"ibc@aliax.net"},"license":"MIT","main":"index.js","browser":{"./lib/Event.js":"./lib/Event.browser.js"},"repository":{"type":"git","url":"git+https://github.com/ibc/yaeti.git"},"devDependencies":{"gulp":"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jscs":"^4.0.0","gulp-jscs-stylish":"^1.4.0","gulp-jshint":"^2.0.4","jshint":"^2.9.4","jshint-stylish":"^2.2.1"},"engines":{"node":">=4.0.0"},"gitHead":"2563b323b138721f1d49aaa00a74304eabcbfa2a","bugs":{"url":"https://github.com/ibc/yaeti/issues"},"homepage":"https://github.com/ibc/yaeti#readme","_id":"yaeti@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"ibc","email":"ibc@aliax.net"},"dist":{"integrity":"sha512-sc1JByruVRqL6GYdIKbcvYw8PRmYeuwtSd376fM13DNE+JjBh37qIlKjCtqg9mKV2N2+xCfyil3Hd6BXN9W1uQ==","shasum":"eb4a978c77189e9649bcbf78dbc1dd18c72050b3","tarball":"http://registry-npm.ywwl.com/yaeti/download/yaeti-1.0.2.tgz","fileCount":10,"unpackedSize":8183,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDncXTDuHULcpF++vUGSc/T8hKw2CL5IpM9UcO4XkcZLgIgOUFfIymcv7tIBZ9LnTS5vAB6C4Cu6WesoHAuANw99Dg="}],"size":3471,"noattachment":false,"key":"/yaeti/-/yaeti-1.0.2.tgz"},"maintainers":[{"name":"ibc","email":"ibc@aliax.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yaeti_1.0.2_1519424561943_0.15618930837825507"},"_hasShrinkwrap":false,"readme":"# yaeti\n\nYet Another [EventTarget](https://developer.mozilla.org/es/docs/Web/API/EventTarget) Implementation.\n\nThe library exposes both the [EventTarget](https://developer.mozilla.org/es/docs/Web/API/EventTarget) interface and the [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) interface.\n\n\n## Installation\n\n```bash\n$ npm install yaeti --save\n```\n\n\n## Usage\n\n```javascript\nvar yaeti = require('yaeti');\n\n// Custom class we want to make an EventTarget.\nfunction Foo() {\n    // Call EventTarget constructor\n    yaeti.EventTarget.call(this);\n}\n// Inherit EventTarget prototype\nFoo.prototype = Object.create(yaeti.EventTarget.prototype);\nFoo.prototype.constructor = Foo;\n\n// Create an instance.\nvar foo = new Foo();\n\nfunction listener1() {\n    console.log('listener1');\n}\n\nfunction listener2() {\n    console.log('listener2');\n}\n \nfoo.addEventListener('bar', listener1);\nfoo.addEventListener('bar', listener2);\nfoo.removeEventListener('bar', listener1);\n\nvar event = new yaeti.Event('bar');\n\nfoo.dispatchEvent(event);\n\n// Output:\n// => \"listener2\"\n```\n\n\n## API\n\n\n### `yaeti.EventTarget` interface\n\nImplementation of the [EventTarget](https://developer.mozilla.org/es/docs/Web/API/EventTarget) interface.\n\n#### ES5\n```javascript\nfunction Foo() {\n    yaeti.EventTarget.call(this);\n}\nFoo.prototype = Object.create(yaeti.EventTarget.prototype);\nFoo.prototype.constructor = Foo;\n```\n\n#### ES6\n```javascript\nclass Foo extends EventTarget () {\n    constructor () {\n        super();\n    }\n}\n```\n\nThe interface implements the `addEventListener`, `removeEventListener` and `dispatchEvent` methods as defined by the W3C.\n\n\n##### `listeners` read-only property\n\nReturns an object whose keys are configured event types (String) and whose values are an array of listeners (functions) for those event types.\n\n\n### `yaeti.Event` interface\n\nImplementation of the [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) interface.\n\n*NOTE:* Just useful in Node (the browser already exposes the native `Event` interface).\n\n```javascript\nvar event = new yaeti.Event('bar');\n```\n\n\n## Author\n\n[Iñaki Baz Castillo](https://inakibaz.me)\n\n\n## License\n\n[MIT](./LICENSE)\n","publish_time":1519424561992,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_cnpm_publish_time":1519424561992,"dist-tags":{"latest":"1.0.3"}}