
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
node-conseq is a small, simple library for handling the nesting explosion. It is heavily inspired by node-seq.
node-conseq can handle node-style EventEmitter callbacks as well as error-as-first-argument callbacks.
var Seq = require('conseq')
var http = require('http')
Seq()
.seq(function () {
http.get({host: 'www.google.com', path: '/index.html'}, this.next)
.on('error', this.error)
})
.seq(function (res) {
if (res.statusCode == 200) {
res.on('data', this.next)
} else {
this.error({message: 'Error ' + res.statusCode})
}
})
.seq(function (data) {
console.log("Got data: " + data)
})
.catch(function (err) {
console.log("there was an error! " + JSON.stringify(err))
})
Use this.next
as a callback to proceed to the next function in the chain. Use this.error
as a callback to be called in an error condition. this.combined
is a convenience, meaning:
function (err, ...) {
if (err) this.error(err)
else this.next(...)
}
Seq()
.seq(function () {
fs.stat('/etc/passwd', this.parcombined)
fs.stat(process.env['HOME'], this.parcombined)
})
.seq(function (results) {
console.log('/etc/passwd', results[0].isFile() ? "is" : "is not", "a file")
console.log(process.env['HOME'], results[1].isDirectory() ? "is" : "is not", "a directory")
})
parcombined
works like combined
does for single action steps. par
is the parallel equivalent of next
, and parerror
for error
.
Install with npm install conseq
. If you want to run the tests, you'll need to install zap.
FAQs
Small, simple callback chaining for async methods
The npm package conseq receives a total of 0 weekly downloads. As such, conseq popularity was classified as not popular.
We found that conseq 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.