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

@nodeboot/aot

v1.4.0

Published

Node-Boot module for Ahead-of-Time (AOT) compilation. Generates node-boot beans and OpenAPI schemas at compile time

Readme

@nodeboot/aot

🧠 Ahead-of-Time (AOT) support for the Node-Boot framework — enabling faster startup, intelligent component scanning, and OpenAPI-ready model schemas.


✨ Overview

@nodeboot/aot provides a set of tools and decorators to optimize Node-Boot apps for production, by shifting expensive runtime operations to build-time via Ahead-of-Time (AOT) processing.

It includes:

  • 🔍 Bean Scanner & Generator (node-boot-aot-beans.js) Scans compiled files for decorators like @Service, @Controller, etc., and generates a precomputed node-boot-beans.json.

  • 📦 Component Scanner Decorator (@EnableComponentScan) Automatically imports application components at runtime from the prebuilt manifest or falls back to dynamic scanning.

  • 🧬 Model Schema Generator (node-boot-aot-models.js) Converts @Model-decorated classes into OpenAPI-compatible JSON Schemas.


📦 Installation

npm install @nodeboot/aot --save-dev

⚙️ Usage Guide

1. 🧠 Generate AOT Beans Metadata

After building your app (tsc), run the AOT bean scanner to precompile metadata for your components:

node node-boot-aot-beans.js

Add to package.json:

{
    "scripts": {
        "postbuild": "node node-boot-aot-beans.js"
    }
}

This will output dist/node-boot-beans.json — a list of all .js files that contain key decorators such as @Service, @Controller, etc.


2. 🧬 Generate OpenAPI JSON Schemas from @Model Classes

To convert all @Model-decorated classes into OpenAPI-compatible schema:

node node-boot-aot-models.js

This will generate: dist/node-boot-models.json — structured like:

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "components": {
        "schemas": {
            "UserModel": {
                "type": "object",
                "properties": {
                    "id": {"type": "string"},
                    "name": {"type": "string"}
                }
            }
        }
    }
}

🔁 All-in-One Runner

Runs both scripts in one go. Ideal for post-build automation.

node node-boot-aot.js

💡 Suggested in package.json:

{
    "scripts": {
        "postbuild": "node node-boot-aot.js"
    }
}

🧠 Runtime Integration

In your main application class, use the @EnableComponentScan() decorator to bootstrap bean registration:

import {EnableComponentScan} from "@nodeboot/aot";

@EnableComponentScan()
@NodeBootApplication()
export class MyApp implements NodeBootApp {
    start(): Promise<NodeBootAppView> {
        return NodeBoot.run(ExpressServer);
    }
}

Optional: Use Custom Decorators

@EnableComponentScan({
  customDecorators: [MyCustomBean, AnotherDecorator]
})

✅ Automatically resolves the dist/ directory in production and performs active scanning in dev (or if no JSON file is found).


📁 Directory Expectations

| Directory | Purpose | | --------: | ------------------------------------------------------------- | | src/ | Your TypeScript source files | | dist/ | Compiled output after tsc | | .json | Output files: node-boot-beans.json, node-boot-models.json |


🛠 Internals

Scripts

  • node-boot-aot-beans.js: Scans compiled JS files for known decorators (@Service, @Controller, etc.) and generates node-boot-beans.json.

  • node-boot-aot-models.js: Scans @Model()-decorated classes and generates a JSON Schema file (node-boot-models.json).

  • node-boot-cycle-detector.js: Detects circular dependencies in the bean graph, ensuring no infinite loops in component/service resolution.

  • node-boot-aot.js: Combines all AOT scripts into a single runner for convenience.

Decorator

  • @EnableComponentScan(options?: { customDecorators?: Function[] }): Scans and imports bean modules based on decorators. Uses prebuilt JSON for performance when available.

✅ Benefits

  • Fast Startup: Avoids expensive runtime filesystem scans in production.
  • Predictable Component Importing: Always imports only what’s required.
  • OpenAPI-Ready: JSON schema generation for API modeling & docs.
  • Flexible: Supports custom decorators and intelligent fallbacks.

🔮 Future Ideas

  • CLI interface for all AOT operations
  • Watch mode for development
  • Decorator metadata validation

👨‍💻 Author

Manuel Santos 📧 [email protected] 🌐 GitHub


📝 License

MIT — feel free to use, modify, and contribute.