2.0.2 • Published 1 year ago

forst v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

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 conf

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');

forst('test', './conf').then(config => console.log(config));

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

Getting the nested configuration:

const forst = require('forst');

forst(['test', 'test/foo'], './conf').then(config => console.log(config));

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

2.0.2

1 year ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago