Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    slapublic

    node-sla

    A tiny SLA node module that avoids setTimeout boilerplate code and allows an elapsed callback to be passed.

    Example

    var sla = require('sla');
     
    //Will execute the code in the first callback 
    sla(1000, function(done) {
        console.log("Waiting....");
        setTimeout(done,900);
      }, function() {
        console.log("Elapsed");
      });
      
    //Will execute the code in the second(elapsed) callback 
    sla(1000, function(done) {
        console.log("Waiting....");
        setTimeout(done,1001);
      }, function() {
        console.log("Elapsed");
      });

    Installation

    $ npm install sla
    

    Keywords

    none

    install

    npm i sla

    Downloadsweekly downloads

    3

    version

    0.0.3

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar
    • avatar