Socket
Socket
Sign inDemoInstall

config-module

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    config-module

Configuration loader that creates a default module if it does not exist


Version published
Weekly downloads
12
increased by300%
Maintainers
1
Install size
15.9 kB
Created
Weekly downloads
 

Changelog

Source

[1.1.1] - 2017-06-20

  • Fixed a bug with file writing

Readme

Source

config-module

Configuration loader that creates a default config.js module if one does not exist.

The config.js module it creates is either not present and one is created with the configuration passed, or if it's already there, it will return the existing saved configuration.

Once the config.js has been created on its first run, you can then change its values to meet your requirements.

Example Usage:

const ConfigModule = require('config-module');

// load config or use the default configuration 
// and save it as config.js
const config = ConfigModule.load({
   service: {
       domain: 'https://some.place.com',
       username: 'yourusername@yourdomain.com',
       password: 'supersecretpassword'
   },
   somethingElse: {
       this: 'the other thing'
   }
});

console.log(config.service.domain); 
// will return: https://some.place.com

Keywords

FAQs

Last updated on 12 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc