
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
name-all-the-things
Advanced tools
With Node.js, there are several situations in which using anonymous functions is less than helpful for debugging purposes.
Name All The Things (name-all-the-things) is a Node.js require hook which
scans any loaded modules, and inserts a name for any functions that it find. The
function names are meant to be somewhat reasonable.
// Putting a name on unnamed functions that initialize vars is easy
var foo = function () {};
// becomes var foo = function anon$foo() {};
// Initializing fields is also easy
{
bar: function () {}
// becomes bar: function anon$bar() {}
}
// Anonymous functions passed directly in as callbacks can be tricky. These
// are simply given names that indicate the filename and line number
doSomething(someParams, function () {})
// becomes doSomething(someParams, function anon$readme$19() {})
To use name-all-the-things on any Node.js app, install globally and run the
name-all-the-things command.
$ npm i -g name-all-the-things
$ natt app.js
To embed name-all-the-things in your application, add a call to the
register(). Note that this won't be able to instrument anything in this file
itself; just in the modules that are loaded later.
require('not-named');
require('name-all-the-things').register();
require('gets-named');
var alsoNotNamed = function () {}
This module probably doesn't work with most transpilers, since they are trying similar but different hackery to get into the require process. But this isn't very useful with them anyways, since line numbers will be from the generated JavaScript, so they probably won't line up with the original source.
FAQs
Node require hook to put names on anonymous functions
We found that name-all-the-things 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.