Socket
Socket
Sign inDemoInstall

acm

Package Overview
Dependencies
18
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    acm

another configuraiton module


Version published
Maintainers
1
Install size
1.73 MB
Created

Readme

Source

Build Status Coverage Status

acm - another configuration module is a configuration reader. it can retrieve values from command line arguments, environment variables, and local files of different formats.

usage

just requireing acm will return an instantiated Configuration object that uses some pretty standard defaults. this is a function you can use to get your configuration. the funciton object will also have a .set method you can use to update values (in memory) and a .ref property which is the actual Configuration instance. running config('github.username') will result in the following checks:

  1. a --github.username command line argument will be checked
  2. a GITHUB_USERNAME environment variable will be checked
  3. a file named github.{json,json5,yaml,yml,ini} will be checked and parsed for the value
defaults

acm will make sensible decisions about where to check for configuration. for example, when checking for:

  • arguments: defaults to process.argv
  • environment variables: defaults to process.env
  • files: defaults to $PWD/config/ then $PWD
file extension and parsers

available extensions are: .ini, .json/.json5, and .yaml/.yml. parsers for each of these extensions are located in acm.prototype.parsers. adding new properties to this object will add support for addition file extension. property values should be functions that take a string, parse it, and return an object.

file merge fields

files can use merge fields. lodash's template function is used to merge data into string, and acm.prototype.fields is passed as the data argument. by default .fields comes with a reference to process and process.env (labeled as env)

Keywords

FAQs

Last updated on 27 Oct 2015

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