true-noop
v1.3.1
Published
A module that actually returns a real no-op function
Downloads
338
Readme
true-noop
The only true 'no operation' module out there.
Installation
npm install --save true-noop
Usage
let noop = require('true-noop');
noop();
What makes this a true 'no operation' function?
While other 'no-op' modules actually go ahead and create then return a new function, e.g.
module.exports = function() {}
module.exports = () => () => {};
true-noop
exploits the fact that Function.prototype
is in itself a function that does nothing and returns undefined
.
module.exports = Function.prototype;