Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ease-config

A Node.js package that provides a Laravel-inspired configuration system.

Installation

You must install a core

npm install @ease-lab/config

and CLI for generating configs

npm install -D @ease-lab/config-cli

Integrations

  • NestJs Install a nest module npm install @ease-lab/config-nest // TODO

Validation

// TODO

Example

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`)

About

A lightweight configuration system for Node.js applications inspired by Laravel.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages