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

@nyalajs/core

v2.3.1

Published

The foundation of Nyala.js — dependency injection, module system, decorators, and application lifecycle. Every other `@nyalajs/*` package builds on this one; it has no dependencies of its own beyond `reflect-metadata`.

Downloads

564

Readme

@nyalajs/core

The foundation of Nyala.js — dependency injection, module system, decorators, and application lifecycle. Every other @nyalajs/* package builds on this one; it has no dependencies of its own beyond reflect-metadata.

Quick start

import "reflect-metadata";
import { Module, Controller, Get, Injectable, NyalaFactory } from "@nyalajs/core";

@Injectable()
class GreeterService {
  greet(name: string) {
    return `Hello, ${name}`;
  }
}

@Controller("/hello")
class HelloController {
  constructor(private greeter: GreeterService) {}

  @Get("/:name")
  hello(@Param("name") name: string) {
    return { message: this.greeter.greet(name) };
  }
}

@Module({ providers: [GreeterService], controllers: [HelloController] })
class AppModule {}

const app = await NyalaFactory.create(AppModule);
// attach an HTTP adapter (see @nyalajs/http) and app.listen(3000)

What's in this package

  • Modules@Module({ imports, providers, controllers, exports }). The module loader builds a dependency graph, detects circular imports, and validates that anything a module exports is actually provided by it.
  • Dependency injection — constructor injection via @Injectable()/@Inject(token); singleton, request, and transient scopes; a request-scoped child container is created per HTTP request.
  • Controllers & routing metadata@Controller(), @Get()/@Post()/@Put()/@Delete()/@Patch(), @Body()/@Param()/@Query()/@Req()/@Res()/@Headers()/@Cookie() and more — the decorators; @nyalajs/http's FastifyAdapter does the actual binding to a real server.
  • Cross-cutting concerns@UseGuards(), @UseInterceptors(), @Catch()/@UseFilters() for exception filters.
  • Lifecycle hooksOnModuleInit, OnApplicationBootstrap, OnApplicationShutdown.
  • NyalaApplication/NyalaFactory — application bootstrap, plugin registration (app.plugin(...)), global middleware (app.use(...)).
  • ContextTenantContext/LogContext, AsyncLocalStorage-backed request-scoped state readable from anywhere in the call chain, including code with no access to the request object.

Runtime, not just types

This package is a real dependency-injection runtime, not a types-only decorator library — resolving a provider actually walks a dependency graph, instantiates classes with their constructor dependencies injected, and caches according to scope. See @nyalajs/testing's TestingModule for exercising it in tests without spinning up a real HTTP server.

Documentation

Full docs: github.com/nyalajs/nyalajs.