Awesome Open Source
Awesome Open Source
Sponsorship


noop3


◻️ Supreme nothingness

Build Status Coverage Status

Install

$ npm install noop3

Usage

const noop = require('noop3');

function unicorn(fn) {
	fn = fn || noop;
	return fn('unicorn');
}
unicorn();

// Also compatible with non-mythical single horned creatures
function narwhal(fn) {
	fn = fn || noop;
	return fn('narwhal');
}
narwhal();

// Using the noop factory
const fn = require('noop3/factory');
const rainbow = fn();
const flowers = fn();
console.log(rainbow === flowers);
//=> false

rainbow();
//=> undefined

Related

License

MIT © Sindre Sorhus


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (66,004
nodejs (3,447
function (25
unicorns (14

Find Open Source By Browsing 7,000 Topics Across 59 Categories