{"name":"yaeti","version":"0.0.4","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":"https://github.com/ibc/yaeti.git"},"devDependencies":{"gulp":"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jscs":"^1.6.0","gulp-jscs-stylish":"^1.1.0","gulp-jshint":"^1.11.2","jshint-stylish":"~1.0.2"},"engines":{"node":">=0.10.32"},"gitHead":"c28b35176dbbe10e9452fccf12e4cca850a611ae","bugs":{"url":"https://github.com/ibc/yaeti/issues"},"homepage":"https://github.com/ibc/yaeti","_id":"yaeti@0.0.4","scripts":{},"_shasum":"89fe739c45ac4491028973193262a837693a66b6","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"ibc","email":"ibc@aliax.net"},"dist":{"shasum":"89fe739c45ac4491028973193262a837693a66b6","tarball":"http://registry-npm.ywwl.com/yaeti/download/yaeti-0.0.4.tgz","integrity":"sha512-gjoIyQHRknnlDIkNShiqiehrjZrIuWrf+PIcqE5objLW1AXC8nFLSUu3H6D1sTjEIKibxKitmpsUjzICGuRrmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEsdpfZE6EZeHupRC4A8btyylc1rfr9KeQSyUqWRrM0kAiB8L9FxLBaMnDAULJeQpXc3UD+Yw9a08J8UXHMjY4OXBg=="}],"size":3348,"noattachment":false,"key":"/yaeti/-/yaeti-0.0.4.tgz"},"maintainers":[{"name":"ibc","email":"ibc@aliax.net"}],"directories":{},"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":1437565450870,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","_cnpm_publish_time":1437565450870,"dist-tags":{"latest":"1.0.3"}}