A Node.js package that provides a Laravel-inspired configuration system.
You must install a core
npm install @ease-lab/configand CLI for generating configs
npm install -D @ease-lab/config-cli- NestJs
Install a nest module
npm install @ease-lab/config-nest// TODO
// TODO
All configuration files are loaded from the config/ directory. Each file must be a .ts or .js module that default-exports a defineConfig call.
config/app.ts
import { defineConfig } from '@ease-lab/config';
export default defineConfig({
port: 3000,
debug: env('APP_DEBUG', false),
});After creating or updating configuration files, run npx ease-config generate to regenerate all types and values.
Usage in index.ts file
import { config } from '@ease-lab/config';
console.log(config.app.port); // `app` refers to the config file name (`config/app.ts`)