ifthen

0.1.0 • Public • Published

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) {
            //
          }
      );

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    1
  • 0.0.1
    0

Package Sidebar

Install

npm i ifthen

Weekly Downloads

1

Version

0.1.0

License

BSD

Last publish

Collaborators

  • gyllstromk