New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

node-config-normalizer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-config-normalizer

Normalize configuration objects coming from environment, files, and CLI flags.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

node-config-normalizer

Merge configuration objects from several sources — environment values, JSON files, CLI flags — into one plain object with predictable precedence.

Install

npm i node-config-normalizer

Usage

const normalize = require('node-config-normalizer');

const config = normalize(
  {
    server: { port: 8080 },
    logLevel: 'debug'
  },
  {
    server: { host: '127.0.0.1', port: 3000 },
    logLevel: 'info'
  }
);

// {
//   server: { host: '127.0.0.1', port: 8080 },
//   logLevel: 'debug'
// }

Nested plain objects are merged recursively. Everything else — arrays, null, primitives — replaces the previous value. undefined keys are dropped rather than written over a default.

API

normalize(source, defaults?)

Returns a new object. Neither argument is mutated. Both are optional; a non-object argument is treated as {}.

License

MIT

Keywords

config

FAQs

Package last updated on 04 Nov 2026

Related posts