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 11, 2024 via pnpm

queue 7.0.0

asynchronous function queue with adjustable concurrency
Package summary
Share
0
issues
1
license
1
MIT
Package created
4 Nov 2012
Version published
11 Apr 2023
Maintainers
1
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:
queue@7.0.0
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 queue 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does queue do?

'Queue' is a JavaScript module that provides an asynchronous function queue with adjustable concurrency. This npm package manages the execution of asynchronous tasks, making it easy to control the number of concurrent operations running at any given time. The 'Queue' class maintains the sequence of jobs and offers a similar API as JavaScript Array. It begins processing tasks or jobs when you call 'q.start()'.

How do you use queue?

This is a basic rundown on how to use 'Queue':

  1. Installation: You can install 'Queue' with npm or yarn. Here's the command for npm:

    npm install queue
    

    And for yarn:

    yarn add queue
    
  2. Usage: Following is a simple workflow using 'Queue':

    import Queue from 'queue'
    
    const q = new Queue()
    
    // add jobs using Array-like API
    q.push(cb => {
      // ... your async tasks
      cb(null, 'result')
    })
    
    // start processing jobs
    q.start(err => {
      if (err) throw err
      console.log('all done')
    })
    

    You can adjust concurrency by passing it in options:

    const q = new Queue({ concurrency: 2 })
    

    You can also work with promises:

    q.push(() => {
      return new Promise((resolve, reject) => {
        // ... your async operation
        resolve('result')
      })
    })
    

Where are the queue docs?

The complete 'Queue' API documentation is available at Mozilla Developer Network Array API as it implements most of the Array API. For more specific information about 'Queue', you can refer to the README in the package's Github repository: Queue on Github. The README includes detailed information about the constructor options, instance properties, instance methods, and available events that this package provides.