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

@albertoielpo/ielpify

v0.3.0

Published

A simplified way to build Fastify applications using decorators, inspired by NestJS

Readme

@albertoielpo/ielpify

TypeScript decorators for Fastify: controllers, routing, scheduling, and simple dependency injection.

Installation

npm install @albertoielpo/ielpify
npm install reflect-metadata fastify  # peer dependencies

Decorators

Routing

  • @Controller(prefix?) - Define a controller with optional route prefix
  • @Get(path?), @Post(path?), @Put(path?), @Delete(path?), @Patch(path?) - HTTP method decorators

Dependency Injection

  • @Injectable() - Mark a class as a singleton service
  • @Inject(ServiceClass) - Inject a singleton dependency into a constructor parameter

Scheduling

  • @Timeout(options) - Schedule a method to run after a delay, optionally repeating

API Reference

Routing functions

registerController(fastify, ControllerClass)

Registers a controller with a Fastify instance. Creates the controller instance (with DI) and sets up all routes.

registerController(fastify, HomeController);

getControllerInstances()

Returns all registered controller instances. Useful for applying lifecycle operations such as startTimeouts.

const instances = getControllerInstances();

Dependency Injection functions

resolveService(ServiceClass)

Resolves a singleton service from the DI container. Creates the instance on first call, then returns the same instance on subsequent calls. Throws if the class is not decorated with @Injectable().

const service = resolveService(MyService);

registerService(ServiceClass)

Manually registers a service in the DI container (alias for resolveService that discards the return value).

registerService(MyService);

createWithInjection(TargetClass)

Creates an instance of a class with all @Inject()-decorated constructor parameters resolved automatically.

const instance = createWithInjection(MyClass);

isInjectable(TargetClass)

Returns true if the class is decorated with @Injectable().

if (isInjectable(MyService)) { ... }

getContainerInstances()

Returns all service instances currently stored in the DI container. Useful for applying lifecycle operations such as startTimeouts.

const instances = getContainerInstances();

Scheduling functions

startTimeouts(instance)

Starts all @Timeout-decorated methods on a given instance. Call this after all controllers and services are registered.

[...getControllerInstances(), ...getContainerInstances()].forEach(startTimeouts);

TimeoutOptions

| Property | Type | Default | Description | |----------|----------|---------|--------------------------------------------------| | ms | number | — | Delay in milliseconds between each execution | | times | number | 1 | Number of executions. Use -1 for infinite loop |

Example

import { Injectable, Injectable, Inject, Timeout } from "@albertoielpo/ielpify";

@Injectable()
class MyService {
  @Timeout({ ms: 5000, times: 3 })
  poll() {
    console.log("polling...");
  }
}

@Controller("hello")
class HelloController {
  constructor(
    @Inject(MyService) private myService: MyService
  ) {}

  @Get("world")
  helloWorld(req: FastifyRequest, res: FastifyReply) {
    return res.send({ message: "Hello, world!" });
  }
}

const fastify = Fastify();
registerController(fastify, HelloController);
[...getControllerInstances(), ...getContainerInstances()].forEach(startTimeouts);
fastify.listen({ port: 3000 });

See the example/ folder for a complete working demo.

cd example
npm install
npm run dev

Development

To test changes locally without publishing:

npm run build
mkdir -p example/node_modules/@albertoielpo/ielpify
cp -R dist example/node_modules/@albertoielpo/ielpify/
cp package.json example/node_modules/@albertoielpo/ielpify/

License

MIT