New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@koakh/nestjs-auth-quick-config

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koakh/nestjs-auth-quick-config

Add configs to nestjs with auto type parsing

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-87.5%
Maintainers
1
Weekly downloads
 
Created
Source

Nest Logo

.

Package License NPM Downloads circleci

Description

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

Installation

$ npm install nestjs-easyconfig
$ yarn add nestjs-easyconfig

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  {}

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  {}

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. If any keys which are in .env.sample but not in the evironment used, it is immediately reported in console.

Note: To use this, a sample env file .env.sample should be placed in the root dir

Without config file supplied:

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

@Module({
 imports:  [EasyconfigModule.register({})],
})
export  class  AppModule  {}

In this case, you have to pass in the NODE_ENV value and the .env file to read will be determined accordingly. Loads environment variables from .env.[development|test|production][.local] files For example, NODE_ENV=dev will make the app read .env.dev

Note: The .env file also has to be in root folder

Stay in touch

License

The package is MIT licensed.

Support on Beerpay

Hey dude! Help me out for a couple of :beers:!

Beerpay Beerpay

Keywords

FAQs

Package last updated on 10 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc