JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q45341F
  • License MIT

Radix Trie-Based Configuration Platform

Package Exports

  • forst

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (forst) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

forst

Radix Trie Hierarchical Configurations

Build Status: Linux Standard Version Conventional Commits

Setup

Add Forst as a dependency

$ npm install --save forst

Create a folder in which your config tree(s) will live

Example

$ mkdir config

Usage

Consider the following config tree directory

/conf/
├── foo
│   └── bar
│       └── baz.json
├── test
│   ├── bar.json
│   └── foo.json -> { "enabled": false }
└── test.json -> { "enabled": true, "name": "foo" }

Getting the base configuration:

const forst = require('forst');

const config = forst('test', './conf');

console.log(config); // { "enabled": true, "name": "foo" }

Getting the nested configuration:

const forst = require('forst');

const config = forst(['test', 'test/foo'], './conf');

console.log(config); // { "enabled": false,  "name": "foo" }

If the config file is not found it will return either the values of the parent configuration if found or an empty object if nothing is found.

API

Table of Contents

index

forst

Parameters

map

forstMap

Parameters