Skip to main content


Tags CI Status Dependencies License

import { debug } from "";

const log = debug("app");
const name = "My Awesome App"

const app = new Application();

app.use((ctx) => {
  log("%s %s", ctx.request.method, ctx.request.url.pathname);
  ctx.response.body = "Hello World!";

log("Starting %s...", name);
await app.listen({ port: 8000 });
$ DEBUG=worker deno run --allow-env script.ts

Namespace Colors

Every debug instance has a color generated for it based on its namespace name. This helps when visually parsing the debug output to identify which debug instance a debug line belongs to.

Millisecond diff

When actively developing an application it can be useful to see when the time spent between one debug() call and the next. Suppose for example you invoke debug() before requesting a resource, and after as well, the “+NNNms” will show you how much time was spent between calls.


The * character may be used as a wildcard. Suppose for example your library has debuggers named “connect:bodyParser”, “connect:compress”, “connect:session”, instead of listing all three with DEBUG=connect:bodyParser,connect:compress,connect:session, you may simply do DEBUG=connect:*, or to run everything using this module simply use DEBUG=*.

You can also exclude specific debuggers by prefixing them with a “-” character. For example, DEBUG=*,-connect:* would include all debuggers except those starting with “connect:”.


Debug uses printf-style formatting. Below are the officially supported formatters:

Formatter Representation
%O Pretty-print an Object on multiple lines.
%o Pretty-print an Object all on a single line.
%s String.
%d Number (both integer and float).
%j JSON. Replaced with the string ‘[Circular]’ if the argument contains circular references.
%% Single percent sign (‘%’). This does not consume an argument.



  • debug - A tiny JavaScript debugging utility modelled after Node.js core’s debugging technique.


Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.


Copyright 2020-present, the denosaurs team. All rights reserved. MIT license.