{"_id":"isg-events","_rev":"33-51bc58004be41d3958cdba669fe9937e","name":"isg-events","description":"Synchronous and asynchronous cross-platform library for organizing events.","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.10":{"name":"isg-events","version":"0.0.10","keywords":["event","events","underscore","async","sync","on","once","trigger"],"dependencies":{"underscore":"1.5.2","async":"0.2.9"},"devDependencies":{"should":"2.0.2"},"readme":"# isg-events\n0.0.10\n\n# install\n\n* NPM `npm install isg-events`\n* GIT `git clone https://github.com/isglazunov/events.git`\n* download from [releases](https://github.com/isglazunov/events/releases)\n\n# require\n\n## Node.js\n```js\nvar Events = require(\"isg-events\");\n```\n\n## Browser\n```html\n<script src=\"isg-events.js\"></script>\n```\n\n### `define`\n```js\ndefine([\"isg-events\"], function(Events){});\n```\nAbility to connect with define.amd added, but not tested. If something is wrong, fix it.\n\n# usage\nIt is recommended to use in conjunction with the [underscore](https://github.com/jashkenas/underscore) and [async](https://github.com/caolan/async) modules.\n\n## `new Events;`\n```js\nvar events = new Events;\n```\n```js\nvar container = _.extend({}, new Events);\n```\n\n## `events.on(name, callback[, options]);`\nAvailable options:\n```js\n{\n    sync: false, // true // asynchronous / synchronous call handler.\n    context: this, // this in the handler for the default `container`\n    self: false, // true // adds the first argument of `self`\n    limit: null // Number // how many times to call the handler\n}\n```\n\n### Asynchronous event\nThe following will be called only after a call `next`.\n```js\ncontainer.on(\"action\", function(next, arg1, arg2){\n    setTimeout(function(){\n        console.log(\"0\");\n        next();\n    }, 50);\n});\n```\n\n### Synchronous event.\nThe function `next` will be called automatically after the call handler.\n```js\ncontainer.on(\"action\", function(arg1, arg2){\n    setTimeout(function(){\n        console.log(\"1\");\n    }, 100);\n}, {sync: true});\n```\n\n### Access to the handler.\nThe handler described below exclude yourself from the list of event handlers immediately after the call.\n```js\ncontainer.on(\"action\", function(self, next, arg1, arg2){\n    self.off();\n    setTimeout(function(){\n        console.log(\"2\");\n        next();\n    }, 50);\n});\n```\nAvailable attributes of self variable:\n```js\n{\n    index: Number // Personal index of each handler\n    off: Function // Short-cut method to the handler could disable itself\n    limit: Function // Returns a copy of the options limit\n    // If the first argument is a number or null, the option replaces the limit for him\n}\n```\n\n## `events.once(name, callback[, options])`\nEquivalent to calling: `events.on(name, callback, {limit: 1});`\n\n### `events.trigger(name[[, Array arguments], callback];`\n```js\ncontainer.trigger(\"action\", function(){\n    console.log(\"trigger\");\n}); \n```\nIf you call the `trigger` after the announcement of the above handlers, the console will look like this:\n```js\n0\n2\ntrigger\n1\n```\n\n### `events.off(query)`\nAvailable query attributes:\n```js\n{\n    name: undefined, // String\n    callback: undefined, // Function\n    sync: undefined, // Boolean\n    context: undefined, // any\n    self: undefined, // Boolean\n    limit: undefined // Number or Null\n}\n```\nEach specified attribute narrows the scope of the search to detach from the list of handlers.\n```js\ncontainer.off({\n    name: \"action\"\n});\n```\nDisable all event handlers \"action\"\n\n# versions\n## 0.0.10\nBigger readme.\nSome fixes.\n\n## 0.0.9\nThe basic functionality.\n","readmeFilename":"readme.md","description":"0.0.10","_id":"isg-events@0.0.10","dist":{"shasum":"d047d504360b76898e69eee5b8ddde7b54d42482","tarball":"https://registry.npmjs.org/isg-events/-/isg-events-0.0.10.tgz","integrity":"sha512-6NYOUz+eU/gGJevCcj+m3u5W7qEgGVk/xsCNlF1zJ0Md+qqnymFQ7JfrMYIHQtWQ1Xun8zUhdjDvF5CxyS2TOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1EQiWGaTvbeYnwYQHBYu7fOtfiZ9NC9ezMfSWOBMU5QIhAPisc0SVoKInJyTaN0viDHmPU9J56KQQzzObLrbmFbYX"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"isglazunov","email":"isglazunov@gmail.com"},"maintainers":[{"name":"isglazunov","email":"isglazunov@gmail.com"}],"directories":{}},"0.0.12":{"name":"isg-events","version":"0.0.12","keywords":["event","events","underscore","async","sync","on","once","trigger"],"dependencies":{"underscore":"1.5.2","async":"0.2.9"},"devDependencies":{"should":"2.0.2"},"readme":"# isg-events@0.0.12\nSynchronous and asynchronous cross-platform library for organizing events.\n\n# Install\n\n* NPM `npm install isg-events`\n* GIT `git clone https://github.com/isglazunov/events.git`\n* download from [releases](https://github.com/isglazunov/events/releases)\n\n# Require\nDepends on the modules:\n* [underscore@1.5.2](https://github.com/jashkenas/underscore)\n* [async@0.2.9](https://github.com/caolan/async)\n\n## Node.js\n```js\nvar isgEvents = require('isg-events');\nvar Events = isgEvents(require('underscore'), require('async'));\n```\n\n## Browser\n```html\n<script src=\"isg-events.js\"></script>\n```\n```js\nvar Events = new isgEvents(_, async);\n```\n\n### define\n```js\ndefine(['./isg-events.js'], function(isgEvents){\n    var Events = new isgEvents(_, async);\n});\n```\n\n# Usage\n\n## new Events;\n```js\nvar events = new Events;\n```\nor\n```js\nvar MyEvents = function(){};\nMyEvents.prototype = new Events;\n```\n\n## events.on(name, callback[, options]);\nAvailable options:\n```js\n{\n    sync: false, // true // asynchronous / synchronous call handler.\n    context: this, // this in the handler for the default `container`\n    self: false, // true // adds the first argument of `self`\n    limit: null // Number // how many times to call the handler\n}\n```\n\n### Asynchronous event\nThe following will be called only after a call `next`.\n```js\ncontainer.on(\"action\", function(next, arg1, arg2){\n    setTimeout(function(){\n        console.log(\"0\");\n        next();\n    }, 50);\n});\n```\n\n### Synchronous event.\nThe function `next` will be called automatically after the call handler.\n```js\ncontainer.on(\"action\", function(arg1, arg2){\n    setTimeout(function(){\n        console.log(\"1\");\n    }, 100);\n}, {sync: true});\n```\n\n### Access to the handler.\nThe handler described below exclude yourself from the list of event handlers immediately after the call.\n```js\ncontainer.on(\"action\", function(self, next, arg1, arg2){\n    self.off();\n    setTimeout(function(){\n        console.log(\"2\");\n        next();\n    }, 50);\n}, {self: true});\n```\nAvailable attributes of self variable:\n```js\n{\n    index: Number // Personal index of each handler\n    off: Function // Short-cut method to the handler could disable itself\n    limit: Function // Returns a copy of the options limit\n    // If the first argument is a number or null, the option replaces the limit for him\n}\n```\n\n## events.once(name, callback[, options]);\nEquivalent to calling: `events.on(name, callback, {limit: 1});`\n\n## events.trigger(name[[, Array arguments], callback]);\n```js\ncontainer.trigger(\"action\", function(){\n    console.log(\"trigger\");\n}); \n```\nIf you call the `trigger` after the announcement of the above handlers, the console will look like this:\n```js\n0\n2\ntrigger\n1\n```\n\n## events.off(query);\nAvailable query attributes:\n```js\n{\n    name: undefined, // String\n    callback: undefined, // Function\n    sync: undefined, // Boolean\n    context: undefined, // any\n    self: undefined, // Boolean\n    limit: undefined // Number or Null\n}\n```\nEach specified attribute narrows the scope of the search to detach from the list of handlers.\n```js\ncontainer.off({\n    name: \"action\"\n});\n```\nDisable all event handlers \"action\"\n\n## Versions\n### 0.0.12\nNew requiring method for Node.js.\nNew configuration prefix. ~~_events~~ to _isgEvents.\nSome fixes and cleaning.\n\n### 0.0.11\nNew requiring methods.\nSome fixes.\n\n### 0.0.10\nBigger readme.\nSome fixes.\n\n### 0.0.9\nThe basic functionality.\n","readmeFilename":"readme.md","description":"Synchronous and asynchronous cross-platform library for organizing events.","_id":"isg-events@0.0.12","dist":{"shasum":"b47de95d7c5f29b67eaba5bc8f0a9f950a06ad15","tarball":"https://registry.npmjs.org/isg-events/-/isg-events-0.0.12.tgz","integrity":"sha512-ZiOr1XcZu/6Roz8WniITs5uAZtUhe2qF/lJKjOwFys6xCshpX5/VREbdIvzmYGakbIAzqcd5oxKD8zBbm0rpww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY/B4R+uKCceFXZ64K8i5W02bcqPOSmA4UrK8N5cj9qwIhALtwAR8k0iUdXra4h2YIEevBMYNinj+G3sqvNA3CMJf0"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"isglazunov","email":"isglazunov@gmail.com"},"maintainers":[{"name":"isglazunov","email":"isglazunov@gmail.com"}],"directories":{}},"0.1.0":{"author":{"name":"Ivan Sergey Glazunov","email":"isglazunov@gmail.com","url":"https://github.com/isglazunov"},"name":"isg-events","version":"0.1.0","keywords":["event","events","underscore","async","sync","on","once","trigger","off","isg"],"dependencies":{"lodash":"2.2.1","async":"0.2.9"},"devDependencies":{"should":"2.0.2","mocha":"1.13.0"},"readme":"# isg-events@0.1.0\nSynchronous and asynchronous cross-platform library for organizing events.\n\n## Install\n\n* NPM `npm install isg-events`\n* GIT `git clone https://github.com/isglazunov/isg-events.git`\n* download from [releases](https://github.com/isglazunov/isg-events/releases)\n\n## Require\nDepends on the modules:\n* [lodash@2.2.1](https://github.com/lodash/lodash)\n* [async@0.2.9](https://github.com/caolan/async)\n\nIndirect dependency\n* [isg-connector@0.0.2](https://github.com/isglazunov/isg-connector)\n\nThe module can be connected using all supported module [isg-connector@0.0.2](https://github.com/isglazunov/isg-connector) methods.\n\n### window (Browser)\n```html\n<script src=\"isg-events.js\"></script>\n<script>\n    var Events = isgEvents.Events;\n</script>\n```\n\n### define (AMD/Requirejs)\n```js\ndefine(['isg-events.js'], function(isgEvents){\n    var Events = isgEvents.Events;\n});\n```\n\n### require (Node.js)\n```js\nvar isgEvents = require('isg-events');\nvar Events = isgEvents.Events;\n```\n\n## Usage\n\n### Available variables\n\n#### isgEvents.version\nContains the current version of the module.\n\n#### isgEvents.dependencies\nContains links to the required modules.\n\n### new Events;\n```js\nvar events = new Events;\n```\nor\n```js\nvar MyEvents = function(){};\nMyEvents.prototype = new Events;\n```\n\n### events.on(name, callback[, options]);\nAvailable options:\n```js\n{\n    sync: false, // true // asynchronous / synchronous call handler.\n    context: this, // this in the handler for the default `container`\n    self: false, // true // adds the first argument of `self`\n    limit: null // Number // how many times to call the handler\n}\n```\n\n#### Asynchronous event\nThe following will be called only after a call `next`.\n```js\ncontainer.on(\"action\", function(next, arg1, arg2){\n    setTimeout(function(){\n        console.log(\"0\");\n        next();\n    }, 50);\n});\n```\n\n#### Synchronous event.\nThe function `next` will be called automatically after the call handler.\n```js\ncontainer.on(\"action\", function(arg1, arg2){\n    setTimeout(function(){\n        console.log(\"1\");\n    }, 100);\n}, {sync: true});\n```\n\n#### Access to the handler.\nThe handler described below exclude yourself from the list of event handlers immediately after the call.\n```js\ncontainer.on(\"action\", function(self, next, arg1, arg2){\n    self.off();\n    setTimeout(function(){\n        console.log(\"2\");\n        next();\n    }, 50);\n}, {self: true});\n```\nAvailable attributes of self variable:\n```js\n{\n    index: Number // Personal index of each handler\n    off: Function // Short-cut method to the handler could disable itself\n    limit: Function // Returns a copy of the options limit\n    // If the first argument is a number or null, the option replaces the limit for him\n}\n```\n\n### events.once(name, callback[, options]);\nEquivalent to calling: `events.on(name, callback, {limit: 1});`\n\n### events.trigger(name[[, Array arguments], callback]);\n```js\ncontainer.trigger(\"action\", function(){\n    console.log(\"trigger\");\n}); \n```\nIf you call the `trigger` after the announcement of the above handlers, the console will look like this:\n```js\n0\n2\ntrigger\n1\n```\n\n### events.off(query);\nAvailable query attributes:\n```js\n{\n    name: undefined, // String\n    callback: undefined, // Function\n    sync: undefined, // Boolean\n    context: undefined, // any\n    self: undefined, // Boolean\n    limit: undefined // Number or Null\n}\n```\nEach specified attribute narrows the scope of the search to detach from the list of handlers.\n```js\ncontainer.off({\n    name: \"action\"\n});\n```\nDisable all event handlers \"action\"\n\n## Versions\n\n### 0.1.0\nTo connect the module used [isg-connector@0.0.2](https://github.com/isglazunov/isg-connector).\n\n### 0.0.12\nNew requiring method for Node.js.\nNew configuration prefix. ~~_events~~ to _isgEvents.\nSome fixes and cleaning.\n\n### 0.0.11\nNew requiring methods.\nSome fixes.\n\n### 0.0.10\nBigger readme.\nSome fixes.\n\n### 0.0.9\nThe basic functionality.\n","readmeFilename":"readme.md","description":"Synchronous and asynchronous cross-platform library for organizing events.","_id":"isg-events@0.1.0","dist":{"shasum":"ca4473f18ba1ef5e3247771c4d672c50c9c6c189","tarball":"https://registry.npmjs.org/isg-events/-/isg-events-0.1.0.tgz","integrity":"sha512-mxJ1Y/PfGmN9WXp7v2KgLjq7/JiA1GbJCw8msYpZBQNVRZ2JQej/D/8wy1Zsvdqy3g5i4Htou6UF6Te8su5Jzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwbUquuNcC8MhUwHcbJnEo7vZrJZoGSir5Y8hgi1AghgIhAJMTZBYb8EFjyy0DT7+97smAhVojfYtZjaGk8t825vdG"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"isglazunov","email":"isglazunov@gmail.com"},"maintainers":[{"name":"isglazunov","email":"isglazunov@gmail.com"}]}},"readme":"# isg-events\n0.0.10\n\n# install\n\n* NPM `npm install isg-events`\n* GIT `git clone https://github.com/isglazunov/events.git`\n* download from [releases](https://github.com/isglazunov/events/releases)\n\n# require\n\n## Node.js\n```js\nvar Events = require(\"isg-events\");\n```\n\n## Browser\n```html\n<script src=\"isg-events.js\"></script>\n```\n\n### `define`\n```js\ndefine([\"isg-events\"], function(Events){});\n```\nAbility to connect with define.amd added, but not tested. If something is wrong, fix it.\n\n# usage\nIt is recommended to use in conjunction with the [underscore](https://github.com/jashkenas/underscore) and [async](https://github.com/caolan/async) modules.\n\n## `new Events;`\n```js\nvar events = new Events;\n```\n```js\nvar container = _.extend({}, new Events);\n```\n\n## `events.on(name, callback[, options]);`\nAvailable options:\n```js\n{\n    sync: false, // true // asynchronous / synchronous call handler.\n    context: this, // this in the handler for the default `container`\n    self: false, // true // adds the first argument of `self`\n    limit: null // Number // how many times to call the handler\n}\n```\n\n### Asynchronous event\nThe following will be called only after a call `next`.\n```js\ncontainer.on(\"action\", function(next, arg1, arg2){\n    setTimeout(function(){\n        console.log(\"0\");\n        next();\n    }, 50);\n});\n```\n\n### Synchronous event.\nThe function `next` will be called automatically after the call handler.\n```js\ncontainer.on(\"action\", function(arg1, arg2){\n    setTimeout(function(){\n        console.log(\"1\");\n    }, 100);\n}, {sync: true});\n```\n\n### Access to the handler.\nThe handler described below exclude yourself from the list of event handlers immediately after the call.\n```js\ncontainer.on(\"action\", function(self, next, arg1, arg2){\n    self.off();\n    setTimeout(function(){\n        console.log(\"2\");\n        next();\n    }, 50);\n});\n```\nAvailable attributes of self variable:\n```js\n{\n    index: Number // Personal index of each handler\n    off: Function // Short-cut method to the handler could disable itself\n    limit: Function // Returns a copy of the options limit\n    // If the first argument is a number or null, the option replaces the limit for him\n}\n```\n\n## `events.once(name, callback[, options])`\nEquivalent to calling: `events.on(name, callback, {limit: 1});`\n\n### `events.trigger(name[[, Array arguments], callback];`\n```js\ncontainer.trigger(\"action\", function(){\n    console.log(\"trigger\");\n}); \n```\nIf you call the `trigger` after the announcement of the above handlers, the console will look like this:\n```js\n0\n2\ntrigger\n1\n```\n\n### `events.off(query)`\nAvailable query attributes:\n```js\n{\n    name: undefined, // String\n    callback: undefined, // Function\n    sync: undefined, // Boolean\n    context: undefined, // any\n    self: undefined, // Boolean\n    limit: undefined // Number or Null\n}\n```\nEach specified attribute narrows the scope of the search to detach from the list of handlers.\n```js\ncontainer.off({\n    name: \"action\"\n});\n```\nDisable all event handlers \"action\"\n\n# versions\n## 0.0.10\nBigger readme.\nSome fixes.\n\n## 0.0.9\nThe basic functionality.\n","maintainers":[{"name":"isglazunov","email":"isglazunov@gmail.com"}],"time":{"modified":"2022-06-19T02:57:27.464Z","created":"2013-10-24T16:51:25.920Z","0.0.10":"2013-10-24T16:51:31.577Z","0.0.12":"2013-10-26T17:13:41.880Z","0.1.0":"2013-10-31T00:28:13.354Z"},"author":{"name":"Ivan Sergey Glazunov","email":"isglazunov@gmail.com","url":"https://github.com/isglazunov"}}