Skip to content
Provides a few global functions such as `noop`, `throwop`, and `doop`
JavaScript
Find file
Latest commit 5ee341a Feb 27, 2011 @coolaj86 fixed global error
Failed to load latest commit information.
examples fixed global error Feb 27, 2011
noop fixed global error Feb 27, 2011
README.md spell "require" correctly Jan 13, 2011

README.md

node-noop

Provides a few global functions such as noop, throwop, and doop

npm install noop
require('noop');

API

global.noop

Does nothing

function noop() {}

global.throwop(err)

Throws if err is defined

function throwop(err) {
  if (err) {
    throw err;
  }
}

global.doop(callback)

Calls callback or noop

function doop(callback, args, context) {
  if ('function' === typeof callback) {
    callback.apply(context, args);
  }
}
Something went wrong with that request. Please try again.