{"name":"tiny-emitter","version":"2.0.1","description":"A tiny (less than 1k) event emitter library","main":"index.js","scripts":{"test-node":"tape test/index.js | tap-format-spec","test":"testling | tap-format-spec","bundle":"browserify index.js > dist/tinyemitter.js -s TinyEmitter && echo 'Bundled'","minify":"uglifyjs dist/tinyemitter.js -o dist/tinyemitter.min.js -m && echo 'Minified'","build":"npm test && npm run bundle && npm run minify","size":"uglifyjs index.js -o minified.js -m && ls -l && rm minified.js"},"repository":{"type":"git","url":"git+https://github.com/scottcorgan/tiny-emitter.git"},"keywords":["event","emitter","pubsub","tiny","events","bind"],"author":{"name":"Scott Corgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/tiny-emitter/issues"},"devDependencies":{"@tap-format/spec":"0.2.0","browserify":"11.2.0","tape":"4.2.1","testling":"1.7.1","uglify-js":"2.5.0"},"testling":{"files":["test/index.js"],"browsers":["iexplore/10.0","iexplore/9.0","firefox/16..latest","chrome/22..latest","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"gitHead":"e5440fec657b69f1c5a29617344b1eec81e90cfc","homepage":"https://github.com/scottcorgan/tiny-emitter#readme","_id":"tiny-emitter@2.0.1","_shasum":"e65919d91e488e2a78f7ebe827a56c6b188d51af","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"dist":{"shasum":"e65919d91e488e2a78f7ebe827a56c6b188d51af","tarball":"http://registry-npm.ywwl.com/tiny-emitter/download/tiny-emitter-2.0.1.tgz","integrity":"sha512-lyBt17NpqqZEJgL9kAmYnwzo5Pb6I/4QLaKlqzPz35iIYj5BkDYRL7/2XVHD8KPnvt1pCB5SvAwDpd8DmJy8LA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHl9RNzSMbOWEt5HcfzzQlHUTuzkVLauc2I7gi0v4+nYAiEA6TGXUvQqmI/Zp0D9JmT2lSZ+lDsgLHbAWJli7wVaQiI="}],"size":4570,"noattachment":false,"key":"/tiny-emitter/-/tiny-emitter-2.0.1.tgz"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tiny-emitter-2.0.1.tgz_1499253393324_0.34592962940223515"},"directories":{},"readme":"# tiny-emitter\n\nA tiny (less than 1k) event emitter library.\n\n## Install\n\n### npm\n\n```\nnpm install tiny-emitter --save\n```\n\n## Usage\n\n```js\nvar Emitter = require('tiny-emitter');\nvar emitter = new Emitter();\n\nemitter.on('some-event', function (arg1, arg2, arg3) {\n //\n});\n\nemitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');\n```\n\nAlternatively, you can skip the initialization step by requiring `tiny-emitter/instance` instead. This pulls in an already initialized emitter.\n\n```js\nvar emitter = require('tiny-emitter/instance');\n\nemitter.on('some-event', function (arg1, arg2, arg3) {\n //\n});\n\nemitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');\n```\n\n## Instance Methods\n\n### on(event, callback[, context])\n\nSubscribe to an event\n\n* `event` - the name of the event to subscribe to\n* `callback` - the function to call when event is emitted\n* `context` - (OPTIONAL) - the context to bind the event callback to\n\n### once(event, callback[, context])\n\nSubscribe to an event only **once**\n\n* `event` - the name of the event to subscribe to\n* `callback` - the function to call when event is emitted\n* `context` - (OPTIONAL) - the context to bind the event callback to\n\n### off(event[, callback])\n\nUnsubscribe from an event or all events. If no callback is provided, it unsubscribes you from all events.\n\n* `event` - the name of the event to unsubscribe from\n* `callback` - the function used when binding to the event\n\n### emit(event[, arguments...])\n\nTrigger a named event\n\n* `event` - the event name to emit\n* `arguments...` - any number of arguments to pass to the event subscribers\n\n## Test and Build\n\nBuild (Tests, Browserifies, and minifies)\n\n```\nnpm install\nnpm run build\n```\n\nTest\n\n```\nnpm install\nnpm test\n```\n\n## License\n\n[MIT](https://github.com/scottcorgan/tiny-emitter/blob/master/LICENSE)\n","publish_time":1499253394251,"_cnpm_publish_time":1499253394251,"dist-tags":{"latest":"2.1.0"}}