2.0.0 • Published 4 years ago
const-settings v2.0.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-settingsSettings
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.jsonUsage
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