
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
wiretapExtremely tiny debug logging utility for all JavaScript runtimes.
Inspired by debug, but very small and portable.
# npm
npm install w
# yarn
yarn add w
# pnpm
pnpm add w
# bun
bun add w
# deno
deno add jsr:@mkr/wiretap
import { w } from "w";
const log = w("app:main");
log("Creating new user", { email: req.body.email });
const log = w("app:auth");
log("User authentication failed", { email: req.body.email });
If you're a library author, we recommend using your library's name as part of your namespace.
All debug logs are disabled by default, and can be enabled by setting the DEBUG environment variable.
> DEBUG=app:main node index.js
app:main Creating new user { email: 'a@test.com' }
To enable all logs at any level, use *. Naturally DEBUG=* will enable all logs at all levels.
> DEBUG=app:* node index.js
app:main Creating new user { email: 'a@test.com' }
app:auth User authentication failed { email: 'b@test.com' }
Multiple namespaces can be specified by separating them with commas:
> DEBUG=app:main,app:auth node index.js
app:main Creating new user { email: 'a@test.com' }
app:auth User authentication failed { email: 'b@test.com' }
To disable a specific level, prefix the spec with a -:
# all "app" enabled except "app:auth"
> DEBUG=app:*,-app:auth node index.js
app:main Creating new user { email: 'a@test.com' }
🔔 The most specific rule always wins.
Example:
app:*,-app:auth,app:auth:warningExplanation:
- all namespaces under app are enabled
- but app:auth is disabled
- but app:auth:warning is enabled
# notice that we didn't get app:auth, but we did get app:auth:warning > DEBUG=app:*,-app:auth,app:auth:warning node index.js app:main Creating new user { email: 'a@test.com' } app:auth:warning User authentication failed { email: 'b@test.com' }
An individual logger instance can also be enabled or disabled programmatically:
const log = w("app:feature");
// Enable this logger regardless of DEBUG environment
log.enabled = true;
// Disable this logger regardless of DEBUG environment
log.enabled = false;
By default, wiretap will log to stderr. You can customise the logger function used:
const log = w("app:custom");
// Replace the default logger with your own
log.logger = (...args) => console.log("[CUSTOM]", ...args);
FAQs
Extremely tiny debug logging utility for all JavaScript runtimes.
The npm package w receives a total of 13,017 weekly downloads. As such, w popularity was classified as popular.
We found that w 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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.