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

    dothispublic

    dothis

    browser support

    You can use dothis to be able to call functions after a certain period of time (kind of like setTimeout) or on a specific date.

    Example

    var dothis = require( 'dothis' );
     
    // Using with a time
    dothis( function( offBy, percentage ) {  console.log( 'Finished', offBy, 'milliseconds late.' ); })
    .in( 1000 ) // in one second
    .update( function( offBy, percentage ) { console.log( 'We\'re', percentage, 'done.' ) });
     
    // Using with a date
    dothis( function( offBy, percentage ) {  console.log( 'Finished', offBy, 'milliseconds late.' ); })
    .at( new Date( Datw.now() + 1000 ) ) // use a date to represent in one second
    .update( function( offBy, percentage ) { console.log( 'We\'re', percentage, 'done.' ) });

    install

    npm i dothis

    Downloadsweekly downloads

    4

    version

    1.0.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar