{"_id":"chan","_rev":"18-c328ffc5ca0eea246f19b94e131b2357","name":"chan","description":"A go style channel implementation that works nicely with co","dist-tags":{"latest":"0.6.1"},"versions":{"0.0.0":{"name":"chan","version":"0.0.0","description":"A go style channel implementation that works nicely with co","main":"chan.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0"},"_id":"chan@0.0.0","dist":{"shasum":"9003906ef14b4dd77d118c8564bcc79d058351ed","tarball":"https://registry.npmjs.org/chan/-/chan-0.0.0.tgz","integrity":"sha512-X3KBJt5hq7O+MRWYebwuYt9D3CvLXkP/z0gkttbuP5nX3t8r8Ky4ZME/Pduds/2O/YI/xOoCvPsocTf65UiH/Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyYxdgoOyQ3Dav89/ZaaXYB76n0UA+ifyGjqcQ714BaAIhAOfkRCWt6VHsMmsdmQmBN/0O44EYRAzGXEl2Rn49guX7"}]},"_from":".","_npmVersion":"1.3.13","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"directories":{}},"0.1.0":{"name":"chan","version":"0.1.0","description":"A go style channel implementation that works nicely with co","main":"chan.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"}],"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0","co":"~2.3.0","superagent":"~0.15.7","co-wait":"0.0.0"},"_id":"chan@0.1.0","dist":{"shasum":"f0b681ec1a4cf5f77d32cbbfd7df069b9a18ce3c","tarball":"https://registry.npmjs.org/chan/-/chan-0.1.0.tgz","integrity":"sha512-y36XMZ4A4TWIyudNOiX7aleVSmtCG07GRoaH41S+A3h1UV4xuvPzapo5O81NJGb0z7yzK6mK3nPcAx73VnM9+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjh/ZQvzLjE3vozCq3CILOIB7qPT6YeljFgIgfqXlEbAiA7is+xudd8VZAhJa3s3Izg5gk5y7UhPXlczc7s4z7QDA=="}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"directories":{}},"0.2.0":{"name":"chan","version":"0.2.0","description":"A go style channel implementation that works nicely with co","main":"chan.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"}],"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0","co":"~2.3.0","superagent":"~0.15.7","co-wait":"0.0.0","split":"~0.2.10"},"_id":"chan@0.2.0","dist":{"shasum":"cf51cc6a5bd1a11a2dd2ebb2925dff752c7c8e1e","tarball":"https://registry.npmjs.org/chan/-/chan-0.2.0.tgz","integrity":"sha512-oaK68ZIYU9/TZDiPQ9us+ZOshv2MNknL4sZQZ4Qup3kPb8Q4xr0wixyejcGKqC7woEx+2Czn/SUY74kOEdBeMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICjTBJr3u2TDKX+jkGl6BHelOwACxTzmrcuozTQfXoUqAiAhyGmg7Z1UD8AWQa5dVOdDVJeUJVMdHMP27x62OZW9yQ=="}]},"_from":".","_npmVersion":"1.3.15","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"directories":{}},"0.3.0":{"name":"chan","version":"0.3.0","description":"A go style channel implementation that works nicely with co","main":"chan.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"mocha":"~1.14.0","expect.js":"~0.2.0","co":"~2.3.0","superagent":"~0.15.7","co-wait":"0.0.0","split":"~0.2.10"},"_id":"chan@0.3.0","dist":{"shasum":"ade6bd660e2930862c86b8a61e2acf2786c04567","tarball":"https://registry.npmjs.org/chan/-/chan-0.3.0.tgz","integrity":"sha512-ZzF5fphVw+ByZz9158amja/EDDFOX7leA5fuZ8/JzhPqWgoeaDBiJdSmwkNr4RMpFYPminPbEFhwFiOZkuSXrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCo8nw6TWDn2ARAaETPsGmlICfr6AbgjW4CCYuoUx5kZwIhAIt7/j4CYGVEK9f6jArfIDgx0ryRv44/L78I7hiKXI+J"}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}]},"0.6.0":{"name":"chan","version":"0.6.0","description":"A go style channel implementation that works nicely with co","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"co":"^3.0.6","co-wait":"0.0.0","expect.js":"^0.3.1","mocha":"^1.20.1","should":"^4.0.4","sinon":"^1.10.3","split":"^0.3.0","superagent":"^0.18.0"},"_id":"chan@0.6.0","_shasum":"317197625bd9f0d0fd38d25f58f1393e8ba88f59","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"dist":{"shasum":"317197625bd9f0d0fd38d25f58f1393e8ba88f59","tarball":"https://registry.npmjs.org/chan/-/chan-0.6.0.tgz","integrity":"sha512-B2oDFoaR3DwNYy5/niwfYii+hBI/LGTSCFSW6l+4XuZSkN1MeC2KQ3B8kXswT0Hw2V5Zmnljb32wYaMOefkeMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpzjjC9O+zMpj3/qCfBpmrmOe6/27RoE/p8HJ96WOE9QIhANXVzrmG9U/jgdrZOFh3lcNvF3kF0PXFUiqUgVR+jdmM"}]}},"0.6.1":{"name":"chan","version":"0.6.1","description":"A go style channel implementation that works nicely with co","main":"index.js","scripts":{"test":"./node_modules/mocha/bin/mocha"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"keywords":["async","go","channel","co","generator"],"author":{"name":"Brent Burgoyne"},"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"license":"MIT","bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"homepage":"https://github.com/brentburgoyne/chan","devDependencies":{"co":"^3.0.6","co-wait":"0.0.0","expect.js":"^0.3.1","mocha":"^1.20.1","should":"^4.0.4","sinon":"^1.10.3","split":"^0.3.0","superagent":"^0.18.0"},"_id":"chan@0.6.1","_shasum":"ec0ad132e5bc62c27ef10ccbfc4d8dcd8ca00640","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"brentburgoyne","email":"brent47@gmail.com"},"maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"dist":{"shasum":"ec0ad132e5bc62c27ef10ccbfc4d8dcd8ca00640","tarball":"https://registry.npmjs.org/chan/-/chan-0.6.1.tgz","integrity":"sha512-/TdBP2UhbBmw7qnqkzo9Mk4rzvwRv4dlNPXFerqWy90T8oBspKagJNZxrDbExKHhx9uXXHjo3f9mHgs9iKO3nQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9uzLC8kxeWcOtlwbe+2YgBATJmG1odP+YV7S67BU1gAIgSJ5aGZZDRr7RhyOHVNI3TSFtZmKpsAQ6JizR+B7JmgY="}]}}},"readme":"# Chan\n\nA [golang](http://golang.org) like channel implementation for JavaScript that\nworks well with [co](https://github.com/visionmedia/co).\n\n[![Build Status](https://travis-ci.org/brentburgoyne/chan.png)](https://travis-ci.org/brentburgoyne/chan)\n[![Code Climate](https://codeclimate.com/github/brentburgoyne/chan.png)](https://codeclimate.com/github/brentburgoyne/chan)\n[![Dependency Status](https://gemnasium.com/brentburgoyne/chan.png)](https://gemnasium.com/brentburgoyne/chan)\n\n## Features\n\n- CSP Style channels in JavaScript\n- Buffered or Unbuffered channels\n- Channels can be closed\n- API designed to work well with generators and co\n- Can be used without generators\n- Channels can be selected similar to Go's select statement\n\n## Installation\n\n```bash\n$ npm install chan --save\n```\n\n## The Basics\n\nChan is inspired by golang's channels. It is implemented as a function that\nrepresents an asynchronous first in first out queue.\n\n```js\nvar makeChan = require('chan')\n// make a new unbuffered channel\nvar ch = makeChan()\ntypeof ch // -> 'function'\n```\n\n### Sending values to the channel\n\nValues are added to the\nchannel by calling the function with either `(value)` or `(error, value)`. The\nreturn value is a thunk (a function that take a node-style callback as its only\nargument). The callback given to the thunk is called once the value is added.\n\n```js\nch('foo')(function (err) {\n  if (err) {\n    // There was an error putting the value on the channel\n  } else {\n    // The value was successfully put on the channel\n  }\n})\n```\n\n### Receiving values from the channel\n\nValues are removed from the channel by calling it with a node-style callback as\nthis first argument. When a value is available on the channel the callback is\ncalled with the value or error. In this case the channel itself can also be a\nthunk.\n\n```js\nch(function (err, val) {\n  // called when there is a value or error on the channel\n})\n```\n\n### Generators\n\nBecause thunks are yield-able in a co generator, chan works very well when\ncombined with co. Using them together makes chan feel very similar to go\nchannels.\n\n```js\nvar co = require('co')\n\nco(function *() {\n  var val = yield ch\n})\n\nco(function *() {\n  yield ch('foo')\n})\n```\n\n## Buffer\n\nDocs coming soon...\n\n## Close\n\nDocs coming soon...\n\n## Select\n\nDocs coming soon...\n","maintainers":[{"name":"brentburgoyne","email":"brent47@gmail.com"}],"time":{"modified":"2022-06-13T05:52:15.769Z","created":"2013-11-11T20:37:44.185Z","0.0.0":"2013-11-11T20:37:45.036Z","0.1.0":"2013-12-02T01:23:18.844Z","0.2.0":"2013-12-07T20:38:50.279Z","0.3.0":"2014-01-07T21:35:57.115Z","0.6.0":"2014-08-05T12:25:02.331Z","0.6.1":"2014-08-05T12:35:04.465Z"},"author":{"name":"Brent Burgoyne"},"repository":{"type":"git","url":"http://github.com/brentburgoyne/chan"},"users":{"lightspeedc":true,"aaron":true,"vorg":true,"brainpoint":true},"homepage":"https://github.com/brentburgoyne/chan","keywords":["async","go","channel","co","generator"],"contributors":[{"name":"Brent Burgoyne"},{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},{"name":"Eugene Ware","email":"eugene@noblesamurai.com"}],"bugs":{"url":"https://github.com/brentburgoyne/chan/issues"},"license":"MIT","readmeFilename":"README.md"}