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

@golavr/ng-config

v0.1.0

Published

Configuration library for Angular handling environments in continuous delivery.

Downloads

11

Readme

ng-config

Configuration library for Angular handling environments in continuous delivery systems.

Why using ng-config?

Angular comes with built-in mechanism of environment files but this mechanism requires you to build for each environment. This approach doesn't fit to modern development paradigm which advocate for build once - deploy anywhere.

Getting started

Installation

npm install @golavr/ng-config --save

Create files

  1. Create assets/configs folder.
  2. Create assets/configs/env.json file.
  3. Create assets/configs/config.json file.
  4. Create assets/configs/config.prod.json file.
  5. Add more assets/configs/config.$$$.json files to support all environments.

You should have this folder structure:

- assets
    - configs
        - config.json
        - config.prod.json
        - env.json

Note: Library depends on the above folder and file names.

env.json file

Open assets/configs/env.json and add this content:

{
  "env": "prod"
}

In continues delivery system you should edit the env value to target the selected environment.

Note: you can replace prod with other environment $$$ as long as you have assets/configs/config.$$$.json file for it.

How to use?

Lets set two configuration values for demonstration purpose.

Open assets/configs/config.json file and add:

{
    "baseValue": "other configurations will inherit this value",
    "overrideValue": "base"
}

Open assets/configs/config.prod.json file and add:

{
    "overrideValue": "prod"
}

Create interface reflecting the configuration:

export interface MyConfig {
  baseValue: string;
  overrideValue: string;
}

Inject it and use it:

import { Component } from '@angular/core';
import { ConfigService } from 'ng-config';
import { MyConfig } from './my-config';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(config: ConfigService) {
    config.get<MyConfig>().subscribe(conf => console.log(conf.overrideValue));
  }
}

How does it work?

Each request will read config values during the call, so changes can be made to config files while the app is running. The returned config object will be composed from config.json and will be overridden with env config. In continues delivery system you need to edit env.json and set which env config (config.prod.json) will be selected at runtime. You can have multiple env config files like config.integration.json etc.