By placing a specific YAML under config/
and defining the constants, you can easily read the value.
npm install const-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/
.
├── config
│ ├── settings
│ │ ├── fuga.yaml
│ │ └── piyo.yml
│ ├── settings.yaml
│ └── settings.yml
├── package-lock.json
└── package.json
const Settings = require('const-settings').default
Settings.PIYO.forEach(v => console.log(v))
import Settings from 'const-settings'
Settings.PIYO.forEach((v: string) => console.log(v))
npm run test