{"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":"dmitry@baranovskiy.com"}],"dist":{"shasum":"750480e0cf4f8fd5b53c4d8405f0040532e0eebe","tarball":"http://registry-npm.ywwl.com/eve/download/eve-0.5.0.tgz","integrity":"sha512-/3+siAnsKWmu2Gx81dbmqkM+Hhs+z4dkT8/C0Y6mFATJQRpw8f8weeUFs2AMGY++0pwPZuRScGwreeNWpYVMfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxsVH0/L8de/qkqhllmaCz4EDeE9S/poupS55hytnYjAiEAqfEcOaGF8DClx/TfJXxy7/MJEvIO12KBTYTk7WeXydc="}],"size":8506,"noattachment":false,"key":"/eve/-/eve-0.5.0.tgz"},"directories":{},"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","publish_time":1404711977508,"_cnpm_publish_time":1404711977508,"dist-tags":{"beta":"0.6.0-beta.20","latest":"1.3.0"}}