Getting away with Hactoberfest

rubiin

Rubin

Posted on September 30, 2019

Getting away with Hactoberfest

As hacktoberfest is near, I was too bored to search around some great projects to contribute. So I thought I will contribute to of my projects in typescript. I will be adding some more cool features in the module so any extra hands on the deck is highly appreciated. Feel free to fork and tweak around

GitHub logo rubiin / nestjs-easyconfig

Manage nestjs configs on the go 🔥


Package License
NPM Downloads
CI

Description

Nestjs-easyconfig loads configs from your .env (Wraps dotenv module) ⚙️ 🔥

Installation

$ npm install nestjs-easyconfig
$ yarn add nestjs-easyconfig
Enter fullscreen mode Exit fullscreen mode

Usage

With config file supplied (basic):

import { Module } from '@nestjs/common';
import { EasyconfigModule } from 'nestjs-easyconfig';

@Module({
  imports: [EasyconfigModule.register({ path: './config/.env' })],
})
export class AppModule {}
Enter fullscreen mode Exit fullscreen mode

With config file supplied and safe set to true:

import { Module } from '@nestjs/common';
import { EasyconfigModule } from 'nestjs-easyconfig';

@Module({
  imports: [EasyconfigModule.register({ path: './config/.env', safe: true })],
})
export class AppModule {}
Enter fullscreen mode Exit fullscreen mode

By default safe is set to false. When safe is set to true, the module compares the supplied env file with the sample env file to find missing keys…

💖 💪 🙅 🚩
rubiin
Rubin

Posted on September 30, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

A Final Challenge: The Planning Phase
opensource A Final Challenge: The Planning Phase

November 27, 2024

Going with Mattermost!
opensource Going with Mattermost!

November 25, 2024

Week 12: Release 0.3 pull request 2
undefined Week 12: Release 0.3 pull request 2

November 21, 2024

Week 12: Release 0.3 pull request 1
undefined Week 12: Release 0.3 pull request 1

November 20, 2024