easyconfig-ts
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

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.

Package Sidebar

Install

npm i easyconfig-ts

Weekly Downloads

0

Version

1.2.3

License

ISC

Unpacked Size

23.2 kB

Total Files

20

Last publish

Collaborators

  • brewera