Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
A golang like channel implementation for JavaScript that works well with co.
$ npm install chan --save
Chan is inspired by golang's channels. It is implemented as a function that represents an asynchronous first in first out queue.
var makeChan = require('chan')
// make a new unbuffered channel
var ch = makeChan()
typeof ch // -> 'function'
Values are added to the
channel by calling the function with either (value)
or (error, value)
. The
return value is a thunk (a function that take a node-style callback as its only
argument). The callback given to the thunk is called once the value is added.
ch('foo')(function (err) {
if (err) {
// There was an error putting the value on the channel
} else {
// The value was successfully put on the channel
}
})
Values are removed from the channel by calling it with a node-style callback as this first argument. When a value is available on the channel the callback is called with the value or error. In this case the channel itself can also be a thunk.
ch(function (err, val) {
// called when there is a value or error on the channel
})
Because thunks are yield-able in a co generator, chan works very well when combined with co. Using them together makes chan feel very similar to go channels.
var co = require('co')
co(function *() {
var val = yield ch
})
co(function *() {
yield ch('foo')
})
Docs coming soon...
Docs coming soon...
Docs coming soon...
FAQs
A go style channel implementation that works nicely with co
The npm package chan receives a total of 0 weekly downloads. As such, chan popularity was classified as not popular.
We found that chan demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.