New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@wesym/config-loader

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

@wesym/config-loader

Wesym configuration loader

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

config-loader

Installation

npm i @wesym/config-loader

Getting started

// index.js

const configLoader = require('@wesym/config-loader')

// Base configuration for dev
configLoader.setBaseConfig('dev', {
  HOST: 'localhost',
  PORT: 3000,
  SOMETHING_FOR_PROD: false
})

// Base configuration for prod
configLoader.setBaseConfig('prod', {
  HOST: 'localhost',
  PORT: 80,
  SOMETHING_FOR_PROD: true
})

// Retrieve the config matching with the NODE_ENV
// and overrides with prefixed env values
console.log(configLoader.getConfig())

Examples

# Default dev configuration
> NODE_ENV=dev node .
{
  HOST: 'localhost',
  PORT: 3000,
  SOMETHING_FOR_PROD: false
}
# Production configuration with overridden HOST field
> NODE_ENV=prod WESYM_HOST=remote node .
{
  HOST: 'remote',
  PORT: 80,
  SOMETHING_FOR_PROD: true
}

FAQs

Package last updated on 04 May 2020

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