{"name":"crossvent","description":"Cross-platform browser event handling","version":"0.0.1","homepage":"https://github.com/bevacqua/crossvent","author":{"name":"Nicolas Bevacqua","email":"hello@bevacqua.io","url":"http://bevacqua.io"},"license":"MIT","repository":{"type":"git","url":"git://github.com/bevacqua/crossvent.git"},"main":"src/crossvent.js","devDependencies":{"browserify":"^4.1.3","contra":"^1.6.10","gulp":"^3.6.2","gulp-bump":"~0.1.0","gulp-clean":"~0.2.3","gulp-git":"~0.2.0","gulp-header":"^1.0.2","gulp-rename":"~0.2.2","gulp-size":"~0.1.1","gulp-streamify":"0.0.5","gulp-uglify":"~0.1.0","gzip-size":"^1.0.0","jquery":"^1.11.1","pretty-bytes":"^1.0.1","vinyl-source-stream":"^0.1.1"},"gitHead":"a373c2092239e857715308afd86a2021358dc0a8","bugs":{"url":"https://github.com/bevacqua/crossvent/issues"},"_id":"crossvent@0.0.1","scripts":{},"_shasum":"8f648187263e201fe0a62d686e66d103e40e7cdd","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.10.26","_npmUser":{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"},"maintainers":[{"name":"bevacqua","email":"nicolasbevacqua@gmail.com"}],"dist":{"shasum":"8f648187263e201fe0a62d686e66d103e40e7cdd","tarball":"http://registry-npm.ywwl.com/crossvent/download/crossvent-0.0.1.tgz","integrity":"sha512-6WNpdZOuXheOzHcrfKIC0mVd7RgWLIUGHXg1tKyT+KEjDCo3POtYCwlFinm6amUqVE30uD4ndbg+TdCdvNS//Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBCY4+6D9CU4xtz7vK4hfb9U+hkdXyG65OxTlUCgMTzPAiBCgI8CthF268FPhmRR/SEiRHgWFGOy6PlUI215JwEwiA=="}],"size":27549,"noattachment":false,"key":"/crossvent/-/crossvent-0.0.1.tgz"},"directories":{},"readme":"# crossvent\n\n> Cross-platform browser event handling\n\nThe event handler API used by [dominus][1].\n\n# Install\n\nUsing Bower\n\n```shell\nbower install -S crossvent\n```\n\nUsing `npm`\n\n```shell\nnpm install -S crossvent\n```\n\n# API\n\nThe API exposes a few methods that let you deal with event handling in a consistent manner across browsers.\n\n### `crossvent.add(el, type, fn, capturing?)`\n\nAdds an event listener `fn` of type `type` to DOM element `el`.\n\n```js\ncrossvent.add(document.body, 'click', function (e) {\n  console.log('clicked document body');\n});\n```\n\n### `crossvent.remove(el, type, fn, capturing?)`\n\nRemoves an event listener `fn` of type `type` from DOM element `el`.\n\n```js\ncrossvent.add(document.body, 'click', clicked);\ncrossvent.remove(document.body, 'click', clicked);\n\nfunction clicked (e) {\n  console.log('clicked document body');\n}\n```\n\n### `crossvent.fabricate(el, type, model?)`\n\nCreates a synthetic custom event of type `type` and dispatches it on `el`. You can provide a custom `model` which will be accessible as `e.detail`.\n\n```js\ncrossvent.add(document.body, 'sugar', sugary);\ncrossvent.fabricate(document.body, 'sugar', { onTop: true });\n\nfunction sugary (e) {\n  console.log('synthetic sugar' + e.detail.onTop ? ' on top' : '');\n}\n```\n\n# License\n\nMIT\n\n[1]: https://github.com/bevacqua/dominus\n","publish_time":1425323406679,"_cnpm_publish_time":1425323406679,"dist-tags":{"latest":"1.5.5"}}