npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@densetsuuu/docteur

v0.1.1-beta.5

Published

AdonisJS cold start profiler - analyze and optimize your application boot time

Readme

Docteur

AdonisJS cold start profiler - Analyze and optimize your application boot time

Docteur profiles your AdonisJS application's cold start performance. It measures how long each module takes to load and helps you identify bottlenecks in your boot process.

Installation

Install globally:

npm install -g @densetsuuu/docteur
# or
pnpm add -g @densetsuuu/docteur

Usage

Navigate to your AdonisJS project and run:

# Quick diagnosis
docteur diagnose

# Interactive explorer
docteur xray

Commands

docteur diagnose

Analyzes cold start performance and displays a report.

docteur diagnose [options]

| Option | Description | Default | | ------------------- | --------------------------------------- | --------------- | | --top | Number of slowest modules to display | 20 | | --threshold | Only show modules slower than this (ms) | 1 | | --no-node-modules | Exclude node_modules from analysis | false | | --no-group | Don't group modules by package | false | | --entry | Custom entry point to profile | bin/server.ts |

docteur xray

Interactive TUI for exploring module dependencies.

docteur xray [options]

| Option | Description | Default | | --------- | ------------------ | --------------- | | --entry | Custom entry point | bin/server.ts |

Features:

  • Browse slowest modules
  • Drill down into module dependencies
  • See why a module was loaded (import chain)
  • View lazy import recommendations for heavy dependencies
  • Explore provider lifecycle times (register, boot, start, ready)

Keyboard shortcuts:

  • ↑/↓ Navigate
  • Enter Select
  • Tab Switch between Modules/Providers view
  • ←/Backspace/ESC Go back
  • q Quit

Example Output

  🩺 Docteur - Cold Start Analysis
  ─────────────────────────────────

  📊 Summary

  Total boot time:       459.26ms
  Total modules loaded:  447
    App modules:         19
    Node modules:        221
    AdonisJS modules:    186
  Module import time:    72.91ms
  Provider exec time:    12.35ms

  📁 App Files by Category

  🚀 Start Files (4 files, 15.23ms)
  ┌───────────────────────┬──────────┬──────────┬────────────────────────┐
  │ routes.ts             │ 10.53ms  │ 0.19ms   │ █████████████████████  │
  │ kernel.ts             │  2.15ms  │ 0.08ms   │ ████░░░░░░░░░░░░░░░░░  │
  │ env.ts                │  1.89ms  │ 0.12ms   │ ████░░░░░░░░░░░░░░░░░  │
  └───────────────────────┴──────────┴──────────┴────────────────────────┘

  ⚡ Provider Execution Times
  Time spent in register() and boot() methods

  ┌─────────────────────┬──────────┬──────────┬──────────┬────────────┐
  │ Provider            │ Register │ Boot     │ Total    │            │
  ├─────────────────────┼──────────┼──────────┼──────────┼────────────┤
  │ EdgeServiceProvider │ 0.15ms   │ 2.76ms   │ 2.91ms   │ ████████   │
  │ HashServiceProvider │ 0.08ms   │ 1.23ms   │ 1.31ms   │ ████       │
  └─────────────────────┴──────────┴──────────┴──────────┴────────────┘

  ✅ No major issues detected!

How It Works

Docteur measures cold start performance through two complementary approaches:

  1. Module Loading: Uses Node.js ESM loader hooks to intercept every import() and measure how long each module takes to load.

  2. Provider Lifecycle: Subscribes to AdonisJS's built-in tracing channels to measure the duration of provider lifecycle methods (register, boot, start, ready).

Timing Columns

  • Total: Time including all transitive dependencies (cascading impact)
  • Self: Time for just that file (excluding dependencies)

Execution Flow

1. docteur diagnose
       │
       ▼
2. Spawns child process with --import loader.ts
       │
       ▼
3. loader.ts registers ESM hooks + subscribes to tracing channels
       │
       ▼
4. hooks.ts intercepts every import, measures load time
       │
       ▼
5. AdonisJS app starts, HTTP server listens
       │
       ▼
6. CLI detects "started HTTP server", requests results
       │
       ▼
7. Results sent via IPC, report displayed

Requirements

  • AdonisJS v7+
  • Node.js 22+

License

MIT