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

@edirect/config

v11.0.53

Published

Global NestJS configuration module for eDirect applications. Provides environment variable loading via `dotenv` and a `ConfigService` for accessing configuration values across the application.

Readme

@edirect/config

Global NestJS configuration module for eDirect applications. Provides environment variable loading via dotenv and a ConfigService for accessing configuration values across the application.

Features

  • Loads .{NODE_ENV}.env file automatically on startup (e.g., .development.env, .production.env)
  • Global module — register once, inject ConfigService anywhere
  • Simple get(key) / getConfig() API
  • Dual injection tokens: class token (ConfigService) and string constant (CONFIG_SERVICE_TOKEN)

Installation

pnpm add @edirect/config
# or
npm install @edirect/config

Usage

Register in your AppModule

import { Module } from '@nestjs/common';
import { ConfigModule } from '@edirect/config';

@Module({
  imports: [ConfigModule],
})
export class AppModule {}

Because ConfigModule is decorated with @Global(), you only need to import it once at the root module. ConfigService will be available for injection in all feature modules automatically.

Inject ConfigService

import { Injectable } from '@nestjs/common';
import { ConfigService } from '@edirect/config';

@Injectable()
export class MyService {
  constructor(private readonly config: ConfigService) {}

  doSomething() {
    const dbUrl = this.config.get('DATABASE_URL');
    const port = this.config.get('PORT') ?? '3000';
  }
}

API

ConfigService

| Method | Signature | Description | | ------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------- | | constructor | (filePath?: string) | Optionally pass a .env file path. Automatically called with .{NODE_ENV}.env by the module. | | get | (key: string): string \| undefined | Returns the value for the given environment variable key from process.env. | | getConfig | (): IStringMapper | Returns all environment variables as a Record<string, string>. |

CONFIG_SERVICE_TOKEN

An alternative injection token (string constant) for ConfigService. Useful when you need to inject by token rather than by class:

import { Inject } from '@nestjs/common';
import { CONFIG_SERVICE_TOKEN, ConfigService } from '@edirect/config';

constructor(@Inject(CONFIG_SERVICE_TOKEN) private config: ConfigService) {}

Environment File Convention

The module automatically loads .{NODE_ENV}.env from the working directory:

| NODE_ENV | File loaded | | ----------------------- | ------------------ | | development (default) | .development.env | | staging | .staging.env | | production | .production.env | | test | .test.env |

Example .development.env:

PORT=3000
DATABASE_URL=mongodb://localhost:27017/mydb
REDIS_URL=redis://localhost:6379
LOGS_LEVEL=debug

Note: Never commit .env files containing sensitive credentials to version control.

Exports

export { ConfigModule } from './config/config.module';
export { ConfigService } from './config/config.service';
export { CONFIG_SERVICE_TOKEN } from './config/config.constants';
export type { IStringMapper } from './config/config.interfaces';