Socket
Socket
Sign inDemoInstall

bcfg

Package Overview
Dependencies
1
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bcfg

Config parser for bcoin


Version published
Weekly downloads
3.5K
decreased by-14.82%
Maintainers
3
Install size
47.7 kB
Created
Weekly downloads
 

Readme

Source

bcfg

Config parser (used for bcoin).

Usage

const Config = require('bcfg');

// Will consider ~/.my-module the prefix directory.
const config = new Config('my-module', {
  alias: {
    'n': 'network'
  }
});

// Inject some custom options first.
config.inject({
  some: 'user',
  options: 'here'
});

config.load({
  // Parse URL hash
  hash: true,
  // Parse querystring
  query: true,
  // Parse environment
  env: true,
  // Parse args
  argv: true
});

// Will parse ~/.my-module/my-config.conf (throws on FS error).
config.open('my-config.conf');

// These will cast types and throw on incorrect type.
console.log(config.str('username'));
console.log(config.str('password'));
console.log(config.uint('userid'));
console.log(config.float('percent'));
console.log(config.bool('initialize'));

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

  • Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.

Keywords

FAQs

Last updated on 31 Aug 2023

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