![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
invoke is a dead simple asynchronous flow control micro-library. Sequential (.then) and parallel (.and) async functions can be chained into simple steps:
invoke(function (data, callback) {
// I'm an async function!
}).and(function (data, callback) {
// I am too! I execute in parallel with the first function.
}).then(function (data, callback) {
// I run after both of the parallel functions have called back. Their results
// are passed to me as an array via the data arg.
}).rescue(function (err) {
// I'll be invoked if any functions in the call chain call back with an error.
}).end(initialData, function (data) {
// Calling .end initiates invocation of the set of chained steps. The final result
// is passed to this callback.
});
Because I can.
This library is an experiment in flow control, chained APIs, and minimal JS syntax (yes, I skipped all those semi-colons on purpose).
invoke can be installed via npm:
npm install invoke
The API is exposed as a single function that generates a chainable Invocable object.
var invoke = require('invoke');
invoke(function (data, callback) {
somethingAsync(function (err, results) {
callback(err, results);
});
}).then(function (data, callback) {
// and so forth
Take a look at the examples.
Adds a function as a sequential step. This function will not be invoked until all previous steps have called back, and later steps will not be invoked until this function calls back.
Adds a function as a parallel step. This function will not be invoked in parallel with any other functions chained with .and immediately before or immediately after this .and call.
Adds an error handler. This function will be invoked once if any function in the call chain calls back with an error.
Adds a final callback and initiates invocation of the function steps defined in the chain. initialValue
is the initial value passed as the first argument into the first function step.
Install dev dependencies
$ npm install -d
$ npm test
$ npm run-script build
invoke.js is MIT licensed. See LICENSE.
FAQs
Simple flow control library for chaining async functions
We found that invoke 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.