Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 9, 2024 via pnpm

asap 2.0.6

High-priority task queue for Node.js and browsers
Package summary
Share
0
issues
1
license
1
MIT
Package created
12 Jun 2013
Version published
10 Jul 2017
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
asap@2.0.6
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of asap 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does asap do?

ASAP is a high-priority task queue for Node.js and browsers, primarily utilized by promise and asynchronous observer libraries. The asap function in this package enables the execution of a task as soon as possible, right after the completion of the current event and previously scheduled tasks. The package provides a fast event queue that executes tasks until it is empty, optimizing the programming process by scheduling events to occur before yielding for IO, reflow, or redrawing. It's important to note however, that ASAP may interfere with smooth animation and may cause issues in interactive events if the task queue is not empty.

How do you use asap?

To use asap, you simply import it in your JavaScript file and execute your tasks within the asap function. Here's a basic usage example:

var asap = require('asap');

asap(function() {
    // ... your task here ...
});

ASAP can be used recursively without causing stack overflow. However, usage must be checked for infinite loop situations:

function loop() {
    asap(loop);
}

loop();

In case of tasks that may throw exceptions, there's an alternative asap/raw module, which provides the underlying implementation minus the error checking:

var rawAsap = require('asap/raw');
rawAsap(function () {
    // ... task that may throw an exception ...
});

Remember that if the task does throw an error, you will need to manually call rawAsap.requestFlush() before throwing the error or any time after.

Where are the asap docs?

The comprehensive documentation and source code for ASAP can be found on its GitHub repository. This is the primary location where developers can learn more about the functionality, usage details, compatibility, and the underlying principles of the asap package.