config-kit

A universal, layered configuration system.

Usage no npm install needed!

<script type="module">
  import configKit from 'https://cdn.skypack.dev/config-kit';
</script>

README

config-kit

A universal, layered configuration system.

NPM Version NPM Downloads Deps Dev Deps

Features

  • Layered data architecture
  • Schema validation using joi
  • Support for .json, .js, and .xml data stores
  • Default values
  • Environment variable precedence
  • Define custom layers
  • Extensible data store interface
  • Support for array type values
  • Apply parent directory owner when running as sudo

Installation

npm install config-kit --save

Usage

import Config from 'config-kit';

const config = new Config();

config.set('foo.bar', true);

console.log(config.get('foo')); // { "bar": true }

config.load('/path/to/myconfig.json');

License

This project is open source under the Apache Public License v2 and is developed by Axway, Inc and the community. Please read the LICENSE file included in this distribution for more information.