
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
emptyfunction
Advanced tools
Nothing but an empty function closure.
Primarily Intended for optional closures. This allows you to use one empty closure object in your entire project, and whenever you need it, you can just pass it by reference instead of creating a new closure.
npm install emptyfunction
Get the closure from the module
var emptyFunction = require('emptyfunction');
Whenever there's an optional closure, just add the empty function if no closure is provided
function MyClass(closureArgument) {
if (typeof closureArgument === "function") {
this.someFunction = closureArgument
} else {
this.someFunction = emptyFunction;
}
}
Write your class as if the function exists
MyClass.prototype.doSomething = function() {
this.someFunction();
}
Sometimes you might need to verify if the closure is an empty function.
If you're inside the same package you can use:
this.someFunction === emptyFunction
If not, a more hacky solution is to use:
this.someFunction.name === 'emptyFunction'
FAQs
An empty function.
The npm package emptyfunction receives a total of 303 weekly downloads. As such, emptyfunction popularity was classified as not popular.
We found that emptyfunction demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.