Have ideas to improve npm?Join in the discussion! »

    bqe

    1.0.5 • Public • Published

    bqe

    npm version

    bqe - Background Queue Executor

    About

    Execute asynchronous operations in sequence in the background

    Example

    When your code starts up:

    'use strict';
     
    const bqe = require( 'bqe' );
     
     
    bqe.start();

    When you want to add an operation to the background execution queue:

    'use strict';
     
    const bqe = require( 'bqe' );
     
     
    bqe.addOperation({
     
        operation: async () => {
     
            await new Promise( resolve => {
     
                setTimeout( () => {
     
                    console.log( 'operation in background log' );
     
                    resolve();
     
                }, 1000 );
            });
        }
    });

    Install

    npm i bqe

    DownloadsWeekly Downloads

    0

    Version

    1.0.5

    License

    BSD-3-Clause

    Unpacked Size

    4.57 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar