Licence
ISC
Version
2.0.0
Deps
2
Size
6 kB
Vulns
0
Weekly
0
const-settings
Intro
By placing a specific YAML under config/ and defining the constants, you can easily read the value.
Installation
npm install const-settings
Settings
Place the file that defines the constants in config/settings.yaml or config/settings.yml.
If you want to split the file, set YAML under config/settings/.
Configuration Example
├── config
│ ├── settings
│ │ ├── fuga.yaml
│ │ └── piyo.yml
│ ├── settings.yaml
│ └── settings.yml
├── package-lock.json
└── package.json
Usage
JavaScript
const Settings = require('const-settings').default
Settings.PIYO.forEach(v => console.log(v))
TypeScript
import Settings from 'const-settings'
Settings.PIYO.forEach((v: string) => console.log(v))
Test
npm run test