Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

juqueue

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

juqueue

For proper coding and to run sequential asynchronous function.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ju Queue

For proper coding and to run sequential asynchronous function.

Installation

$ npm install juqueue

Usage

var juQueue = require('juqueue');

// To set juQueue options.

juQueue.set({
  running: true,
  pauseTime: 1000
});

// or

juQueue.set("running", true);
juQueue.set("pauseTime", 1000);

// No settings needed at the start. Because all settings have defaults.

// To use queue for functions.

juQueue.get({
  ecb: null, // Write function to catch error.
  list: [
    function (e) {
      //...
      e.next();
    },
    function (e) {
      //...
    }
  ]
});

var juQueue = require('juqueue');
juQueue.get({
  list: [
    function (e) {
      //...
      e.next({ name: "test", model: "test", args: [1, 2] });
    },
    function (e) {
      //...
      e.next();
    },
    function test(e, one, two) {
      var modelValue = e.model;
      //...
    }
  ]
});

Methods

juQueue.set([options]) or juQueue.set(key, value)

Parameters:

  • [options]: Optional object containing any of the following properties:

    • [running]: Indicates the working status of all queues. Default value: true

    • [pauseTime]: Indicates the duration of next pause control. Default value: 1000

Or

  • key: String key names of the above properties (running or pauseTime).

  • value: Value of the above properties (running or pauseTime).

juQueue.get([options])

Parameters:

  • [options]: The object containing of the following properties:

    • [ecb]: Optional error function. Used to catch errors.

    • [list]: Required array of functions. For queue.

e.next([options])

Parameters:

  • [options]: Optional object containing any of the following properties:

    • [step]: The index of the function you want to go directly.

    • [name]: The name of the function you want to go directly.

    • [model]: The object model you want to send to the next function.

    • [args]: The arguments you want to send to the next function.

Examples

Basic Usage

This example shows the most basic way of usage.

License

This software is free to use under the JosephUz. See the LICENSE file for license text and copyright information.

Keywords

FAQs

Package last updated on 01 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc