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

    ifthenpublic

    ifthen: support if/then/else/finally branch logic in Javascript callbacks

    ifthen.if_(/* condition */)
          .then_(
              // required, called if `condition` 
     
              function (callback) {
                  // callback must be called to trigger completion
                  callback();
              })
          .else_(
              // optional; called when `! condition`
              // cannot be specified unless `then_` is
     
              function (callback) {
                  // callback must be called to trigger completion
     
                  callback();
              })
          .finally_(
              // optional, always called after branch completes
     
              function (err) {
                //
              }
          );

    Keywords

    none

    install

    npm i ifthen

    Downloadsweekly downloads

    6

    version

    0.1.0

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar