{"_id":"eve","_rev":"3665756","name":"eve","description":"Simple custom events","dist-tags":{"latest":"0.5.4"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"time":{"modified":"2024-11-29T02:24:06.000Z","created":"2011-04-18T08:34:52.454Z","0.5.4":"2017-04-18T11:44:22.988Z","0.5.3":"2017-02-14T01:51:05.914Z","0.5.2":"2017-02-14T00:34:36.406Z","0.5.1":"2017-01-18T00:29:09.372Z","0.5.0":"2014-07-07T05:46:17.508Z","0.4.2":"2014-05-22T06:23:21.279Z","0.4.1":"2013-08-26T02:20:51.711Z","0.3.5":"2012-07-03T01:37:40.467Z","0.2.4":"2011-04-18T08:34:52.454Z"},"users":{},"author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/adobe-webplatform/eve.git"},"versions":{"0.5.4":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","license":"Apache-2.0","version":"0.5.4","main":"./eve.js","devDependencies":{"mocha":"*","expect.js":"*","eslint":"*","dr.js":"~0.1.0"},"scripts":{"test":"eslint eve.js","build":"node node_modules/dr.js/dr dr.json"},"repository":{"type":"git","url":"git+ssh://git@github.com/adobe-webplatform/eve.git"},"eslintConfig":{"globals":{"window":true,"console":true},"rules":{"block-scoped-var":0,"comma-dangle":0,"no-extra-parens":1,"no-shadow":0,"consistent-return":0,"eqeqeq":0,"no-new-wrappers":0,"no-sequences":1,"radix":2,"new-parens":0,"no-underscore-dangle":0,"no-path-concat":0,"strict":0,"camelcase":0,"no-extend-native":0,"no-loop-func":0,"new-cap":0,"no-unused-expressions":0,"no-mixed-requires":0,"indent":["error",4,{"SwitchCase":1,"VariableDeclarator":1}],"no-multi-spaces":[0,{"exceptions":{"VariableDeclarator":true}}],"no-trailing-spaces":[2,{"skipBlankLines":false}],"no-unused-vars":[2,{"vars":"all","args":"none"}],"space-before-function-paren":[2,{"anonymous":"always","named":"never"}],"quotes":[1,"double","avoid-escape"]}},"gitHead":"30c41dfb9de9679ea4fba10f192cc08cf7142b02","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"homepage":"https://github.com/adobe-webplatform/eve#readme","_id":"eve@0.5.4","_shasum":"67d080b9725291d7e389e34c26860dd97f1debaa","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"dist":{"shasum":"67d080b9725291d7e389e34c26860dd97f1debaa","size":10225,"noattachment":false,"key":"/eve/-/eve-0.5.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.5.4.tgz"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/eve-0.5.4.tgz_1492515861035_0.19881510804407299"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:59.420Z","publish_time":1492515862988,"_cnpm_publish_time":1492515862988},"0.5.3":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","license":"Apache-2.0","version":"0.5.3","main":"./eve.js","devDependencies":{"mocha":"*","expect.js":"*","eslint":"*","dr.js":"~0.1.0"},"scripts":{"test":"./node_modules/eslint/bin/eslint.js eve.js","build":"node node_modules/dr.js/dr dr.json"},"repository":{"type":"git","url":"git+ssh://git@github.com/adobe-webplatform/eve.git"},"eslintConfig":{"globals":{"window":true,"console":true},"rules":{"block-scoped-var":0,"comma-dangle":0,"no-extra-parens":1,"no-shadow":0,"consistent-return":0,"eqeqeq":0,"no-new-wrappers":0,"no-sequences":1,"radix":2,"new-parens":0,"no-underscore-dangle":0,"no-path-concat":0,"strict":0,"camelcase":0,"no-extend-native":0,"no-loop-func":0,"new-cap":0,"no-unused-expressions":0,"no-mixed-requires":0,"quotes":[1,"double","avoid-escape"]}},"gitHead":"d7008f901868beb1a2e1b1d7bca438e152b7bbd6","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"homepage":"https://github.com/adobe-webplatform/eve#readme","_id":"eve@0.5.3","_shasum":"6c2f6588f7d0b392044d245ba5af9d7cfe237f42","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"dist":{"shasum":"6c2f6588f7d0b392044d245ba5af9d7cfe237f42","size":10091,"noattachment":false,"key":"/eve/-/eve-0.5.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.5.3.tgz"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/eve-0.5.3.tgz_1487037065697_0.9594667991623282"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:59.327Z","publish_time":1487037065914,"_cnpm_publish_time":1487037065914},"0.5.2":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.5.2","main":"./eve.js","repository":{"type":"git","url":"git+ssh://git@github.com/adobe-webplatform/eve.git"},"gitHead":"54ae09d450618c4825d1d726d47ff581bdfb5b1f","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"homepage":"https://github.com/adobe-webplatform/eve#readme","_id":"eve@0.5.2","scripts":{},"_shasum":"90c5572cc188a85b2c84eaca4c1db9c50acea907","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"dist":{"shasum":"90c5572cc188a85b2c84eaca4c1db9c50acea907","size":8679,"noattachment":false,"key":"/eve/-/eve-0.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.5.2.tgz"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/eve-0.5.2.tgz_1487032474540_0.7164218814577907"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:58.501Z","publish_time":1487032476406,"_cnpm_publish_time":1487032476406},"0.5.1":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.5.1","main":"./eve.js","repository":{"type":"git","url":"git+ssh://git@github.com/adobe-webplatform/eve.git"},"gitHead":"236632512cc4fe239f994374f2c711a8709c71fb","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"homepage":"https://github.com/adobe-webplatform/eve#readme","_id":"eve@0.5.1","scripts":{},"_shasum":"5a78ebeb9b28628405f59fc1fb630b4db6933d3e","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"dist":{"shasum":"5a78ebeb9b28628405f59fc1fb630b4db6933d3e","size":8654,"noattachment":false,"key":"/eve/-/eve-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.5.1.tgz"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/eve-0.5.1.tgz_1484699348627_0.00738700432702899"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:57.716Z","publish_time":1484699349372,"_cnpm_publish_time":1484699349372},"0.5.0":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.5.0","main":"./eve.js","repository":{"type":"git","url":"git@github.com:adobe-webplatform/eve.git"},"gitHead":"e5743970ae26ec1e6ce099ca5e6492c727ed7147","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"homepage":"https://github.com/adobe-webplatform/eve","_id":"eve@0.5.0","scripts":{},"_shasum":"750480e0cf4f8fd5b53c4d8405f0040532e0eebe","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"dist":{"shasum":"750480e0cf4f8fd5b53c4d8405f0040532e0eebe","size":8506,"noattachment":false,"key":"/eve/-/eve-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.5.0.tgz"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:56.898Z","publish_time":1404711977508,"_cnpm_publish_time":1404711977508},"0.4.2":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.4.2","main":"./eve.js","repository":{"type":"git","url":"git@github.com:adobe-webplatform/eve.git"},"bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"_id":"eve@0.4.2","dist":{"shasum":"7eea0afc0e4efb7c9365615315a3576833ead2ae","size":8187,"noattachment":false,"key":"/eve/-/eve-0.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.4.2.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:56.129Z","publish_time":1400739801279,"_cnpm_publish_time":1400739801279},"0.4.1":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.4.1","main":"./eve.js","repository":{"type":"git","url":"git@github.com:adobe-webplatform/eve.git"},"bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"_id":"eve@0.4.1","dist":{"shasum":"4a65c458fb262da3137fad443cc00471525ecc1f","size":7983,"noattachment":false,"key":"/eve/-/eve-0.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.4.1.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:56.040Z","publish_time":1377483651711,"_cnpm_publish_time":1377483651711},"0.3.5":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"description":"Simple custom events","version":"0.3.5","main":"./eve.js","repository":{"type":"git","url":"git@github.com:DmitryBaranovskiy/eve.git"},"_npmUser":{"name":"dmitrybaranovskiy","email":"dmitry@baranovskiy.com"},"_id":"eve@0.3.5","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"018321c98af44638a4750e94d43df1882163fcaf","size":66948,"noattachment":false,"key":"/eve/-/eve-0.3.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.3.5.tgz"},"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:55.956Z","publish_time":1341279460467,"_cnpm_publish_time":1341279460467},"0.2.4":{"name":"eve","author":{"name":"Dmitry Baranovskiy","email":"dmitry@baranovskiy.com","url":"http://dmitry.baranovskiy.com"},"version":"0.2.4","main":"./eve.js","repository":{"type":"git","url":"git@github.com:DmitryBaranovskiy/eve.git"},"dependencies":{},"devDependencies":{},"_id":"eve@0.2.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.1rc7","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"6324659497bccf9bb794203d7d8a35d3e74f8020","size":61645,"noattachment":false,"key":"/eve/-/eve-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/eve/download/eve-0.2.4.tgz"},"directories":{},"_cnpmcore_publish_time":"2022-03-24T22:50:54.848Z","publish_time":1303115692454,"maintainers":[{"name":"dmitrybaranovskiy","email":""}],"_cnpm_publish_time":1303115692454}},"readme":"# Eve\n\nTiny event helping JavaScript library.\n\n## eve(name, scope, varargs)\nFires event with given `name`, given scope and other parameters.\n\n### Parameters\n- _name_  **string**\n    name of the _event_, dot (`.`) or slash (`/`) separated\n- _scope_  **object**\n    context for the event handlers\n- _varargs_  **...**\n    the rest of arguments will be sent to event handlers\n\n**Returns:**  **object** array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.\n\n## eve.listeners(name)\nInternal method which gives you array of all event handlers that will be triggered by the given `name`.\n\n### Parameters\n- _name_  **string**\n    name of the event, dot (`.`) or slash (`/`) separated\n\n**Returns:**  **array** array of event handlers\n\n## eve.separator(separator)\nIf for some reasons you don’t like default separators (`.` or `/`) you can specify yours\nhere. Be aware that if you pass a string longer than one character it will be treated as\na list of characters.\n\n### Parameters\n- _separator_  **string**\n    new separator. Empty string resets to default: `.` or `/`.\n\n\n## eve.on(name, f, name, f)\nBinds given event handler with a given name. You can use wildcards “`*`” for the names:\n\n```js\neve.on(\"*.under.*\", f);\neve(\"mouse.under.floor\"); // triggers f\n```\nUse <a href=\"#eve\" class=\"dr-link\">eve</a> to trigger the listener.\n\n### Parameters\n- _name_  **string**\n    name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n- _f_  **function**\n    event handler function\n- _name_  **array**\n    if you don’t want to use separators, you can use array of strings\n- _f_  **function**\n    event handler function\n\n**Returns:**  **function** returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.\n\n### Example:\n```js\neve.on(\"mouse\", eatIt)(2);\neve.on(\"mouse\", scream);\neve.on(\"mouse\", catchIt)(1);\n```\nThis will ensure that `catchIt` function will be called before `eatIt`.\n\nIf you want to put your handler before non-indexed handlers, specify a negative value.\nNote: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.\n\n\n## eve.f(event, varargs)\nReturns function that will fire given event with optional arguments.\nArguments that will be passed to the result function will be also\nconcated to the list of final arguments.\n\n```js\nel.onclick = eve.f(\"click\", 1, 2);\neve.on(\"click\", function (a, b, c) {\n    console.log(a, b, c); // 1, 2, [event object]\n});\n```\n### Parameters\n- _event_  **string**\n    event name\n- _varargs_  **…**\n    and any other arguments\n\n**Returns:**  **function** possible event handler function\n\n## eve.stop()\nIs used inside an event handler to stop the event, preventing any subsequent listeners from firing.\n\n\n## eve.nt([subname])\nCould be used inside event handler to figure out actual name of the event.\n\n### Parameters\n- _subname_  **string**\n    subname of the event\n\n**Returns:**  **string** name of the event, if `subname` is not specified\nor\n\n**Returns:**  **boolean** `true`, if current event’s name contains `subname`\n\n## eve.nts()\nCould be used inside event handler to figure out actual name of the event.\n\n**Returns:**  **array** names of the event\n\n## eve.off(name, f)\nRemoves given function from the list of event listeners assigned to given name.\nIf no arguments specified all the events will be cleared.\n\n### Parameters\n- _name_  **string**\n    name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n- _f_  **function**\n    event handler function\n\n\n## eve.unbind()\nSee <a href=\"#eve.off\" class=\"dr-link\">eve.off</a>\n\n\n## eve.once(name, f)\nBinds given event handler with a given name to only run once then unbind itself.\n\n```js\neve.once(\"login\", f);\neve(\"login\"); // triggers f\neve(\"login\"); // no listeners\n```\nUse <a href=\"#eve\" class=\"dr-link\">eve</a> to trigger the listener.\n\n### Parameters\n- _name_  **string**\n    name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards\n- _f_  **function**\n    event handler function\n\n**Returns:**  **function** same return function as <a href=\"#eve.on\" class=\"dr-link\">eve.on</a>\n\n## eve.version()\nCurrent version of the library.\n\n\n","_attachments":{},"homepage":"https://github.com/adobe-webplatform/eve#readme","bugs":{"url":"https://github.com/adobe-webplatform/eve/issues"},"license":"Apache-2.0"}