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

@followtheowlets/yaml-conf

v1.0.2-b

Published

Yaml config for nest js

Readme

@followtheowlets/yaml-conf

Description

@followtheowlets/yaml-conf is a configuration module for NestJS applications that loads settings from a single YAML configuration file with EJS templating. It automatically populates variables based on the NODE_ENV profile and .env files, following best practices for environment variable management.

Installation

Install the package using npm:

npm install @followtheowlets/yaml-conf

Or using yarn:

yarn add @followtheowlets/yaml-conf

Usage

Importing the Module in a NestJS Application

import { Global, Module } from '@nestjs/common';
import { YamlConfigModule } from '@followtheowlets/yaml-conf';
import { ConfigService } from '@nestjs/config';

@Global()
@Module({
   imports: [YamlConfigModule.forRoot({ filePath: 'config' })],
   providers: [ConfigService],
   exports: [ConfigService],
})
export class AppModule {}

How It Works

  1. One single YAML configuration fileapp.config.yaml.
  2. Environment variables are injected dynamically using EJS templates.
  3. NODE_ENV determines which .env files are loaded, following best practices:
    • .env.{NODE_ENV}.local
    • .env.{NODE_ENV}
    • .env.local
    • .env
  4. Configuration files can be placed in a custom directory, specified via filePath.

Core Components

YamlConfigModule

This module provides access to configuration.

  • forRoot(options?: ConfigOptions): DynamicModule — Loads the configuration from the specified directory or defaults to the root directory.
  • forRootAsync(optionsPromise?: Promise<ConfigOptions>): Promise<DynamicModule> — Asynchronously loads configuration.
  • If filePath is provided, it will load app.config.yaml and .env files from that directory.

Configuration File Examples

.env

PORT=443
HOST=127.0.0.1
DATABASE_URL=postgres://user:password@localhost:5432/mydb

.env.production

PORT=443
HOST=192.168.1.1
DATABASE_URL=postgres://user:password@prod-db:5432/prod_db

app.config.yaml

http:
  port: <%= process.env.PORT || 3000 %>
  host: <%= process.env.HOST %>
database:
  url: <%= process.env.DATABASE_URL %>
property:
  name: custom-property
  example-list:
    - first
    - second

Environment Variables Handling

  • The main configuration file is always app.config.yaml.
  • Environment variables are loaded based on NODE_ENV.
  • If filePath is specified, all configuration files will be loaded from that directory.

Best Practices & Naming Conventions

  • .env.{NODE_ENV}.local – Local overrides for a specific environment.
  • .env.{NODE_ENV} – Environment-specific variables.
  • .env.local – General local overrides.
  • .env – Default environment file.
  • app.config.yaml – Single source of configuration with templating support.

License

This project is licensed under ISC.

Author

Developed by Fedorichev Lev.