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

nimbus-config

v1.0.1

Published

A TypeScript library for file-based configuration management (JSON or YAML) with environment and command-line overrides.

Downloads

14

Readme

nimbus-config

English | 繁體中文

套件名稱已由原本的 json-env-configure 正式更名為 nimbus-config

套件特性與優點

nimbus-config 是一個專為 Node.js 應用程式設計的 TypeScript 套件,提供以檔案(JSON 或 YAML)為基礎的設定管理,並支援環境變數與命令列參數覆寫。

主要特性:

  • 支援 JSON 與 YAML 設定檔
  • 可用環境變數覆寫設定
  • 可用命令列參數覆寫設定
  • 支援陣列與深層物件合併
  • 易於整合於 CLI 或伺服器專案
  • TypeScript 型別安全

安裝

npm install nimbus-config

快速範例

假設有一個設定檔 appsettings.json

{
  "name": "my-app",
  "version": "1.0.0",
  "database": {
    "host": "localhost",
    "port": 5432
  },
  "logging": {
    "level": "info"
  }
}

初始化並載入設定:

import { AppConfigure } from 'nimbus-config';

AppConfigure.initAppConfig({
  configFileOptions: {
    fileType: 'json',
    rootPath: __dirname,
    filename: 'appsettings.json'
  },
  envOptions: {
    prefix: 'App',
    delimiter: '__'
  },
  keyPathDelimiter: '.',
  arrayMergeMode: 'section'
});

// 取得完整設定
const config = AppConfigure.getInstance().config;

// 取得某個區段
const dbConfig = AppConfigure.getInstance().getSection('database');
console.log(dbConfig.host); // 'localhost'

// 環境變數覆寫範例:
// App__database__host=env-db-host
// 會覆寫 config.database.host 為 'env-db-host'

// 命令列覆寫範例:
// node app.js --database.port=9999
// 會覆寫 config.database.port 為 9999

Node.js JavaScript 範例

假設有一個設定檔 appsettings.json

{
  "name": "my-app",
  "version": "1.0.0",
  "database": {
    "host": "localhost",
    "port": 5432
  },
  "logging": {
    "level": "info"
  }
}

JavaScript 初始化與載入設定:

const { AppConfigure } = require('nimbus-config');

AppConfigure.initAppConfig({
  configFileOptions: {
    fileType: 'json',
    rootPath: __dirname,
    filename: 'appsettings.json'
  },
  envOptions: {
    prefix: 'App',
    delimiter: '__'
  },
  keyPathDelimiter: '.',
  arrayMergeMode: 'section'
});

// 取得完整設定
const config = AppConfigure.getInstance().config;

// 取得某個區段
const dbConfig = AppConfigure.getInstance().getSection('database');
console.log(dbConfig.host); // 'localhost'

授權

MIT License

English README