Skip to content

adamhb123/easyconfig-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyConfig-TS

Simple configuration helper for applications in TypeScript and Javascript.

Adds dot file fallback functionality for dotenv.

Installation

npm install easyconfig-ts --save-dev

Usage

Very simple:

import EasyConfig from "easyconfig-ts";
// See (or import { EasyConfigOptions } from "easyconfig-ts") EasyConfigOptions in easyconfig.ts
EasyConfig({
    dotFiles: [
        "./first.env",
        "./second.env",
        ...
    ]
});

or

import EasyConfig from "easyconfig-ts";
EasyConfig([{
    path: "./first.env",
    priority: 1 // Highest priority value - so this will be assessed first
  }, {
    path: "./last.env",
    priority: 0 // Lowest priority value - so this will be assessed last
  },
 ...
 ]);

And that's it! The first found dot file provided to EasyConfig will be chosen and will be used in a Dotenv.config call.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published