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

    onboot

    1.0.0 • Public • Published

    onboot

    Simple script to register boot strap functions before the bootup actually occurs.

    Supports synchronous and asynchronous bootstrapping functions.

    usage

    1. Set your boot strap calls
    2. Define your bootup function

    example

    var boot = require('onboot');
     
    // synchronous
    boot.strap(function () {
      // do dependency work
    });
     
    // asynchronous
    boot.strap(function (done) {
      setTimeout(function () {
        // some async task
        done();
      }, 2500);
    });
     
    boot.up(function () {
      // start server
    });

    todo

    • client side support (yes, simple, but I'm in a hurry)
    • more tests
    • timeout?

    Keywords

    Install

    npm i onboot

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • avatar