true-noop
The only true 'no operation' module out there.
Installation
npm install --save true-noop
Usage
let 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;