Socket
Book a DemoInstallSign in
Socket

ara-runtime-configuration

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ara-runtime-configuration

ARA Runtime Configuration (.ararc)

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

ara-runtime-configuration

Ara Runtime Configuration (Reads from the nearest .ararc file.)

Status

Stable

Installation

$ npm install arablocks/ara-runtime-configuration

Usage

To load Runtime Configuration for any Ara related modules, simply require this module and call the default exported function. You can pass an object specifying default values that may not be present in an .ararc

const rc = require('ara-runtime-configuration')
const conf = rc({
  network: { node: { dns: { multicast: false } } }
})
[web3]
provider = ws://127.0.0.1:8546

[network.identity]
keyring = /home/vipyne/.ara/keyring
root = /home/vipyne/.ara/identities

Example

Example .ararc

API

const conf = rc(conf, name)

Load runtime configuration defined in the nearest .ararc file on disk optionally specifying defaults.

  • conf - Optional default configuration object or function. If conf is a function, it will be passed the base runtime config object.
  • name - Optional name to override default ara rc name

araconf(1)

araconf is a tool for quickly reading values in the closest configuration file. It uses json-select to support JSONPath queries.

Usage

araconf can be used directly from command line. It accepts a single optional JSONPath query and emits valid JSON to stdout.

usage: araconf [-hV] [options] [query]

Options:
  -D, --debug    Enable debug output      [boolean]
  -h, --help     Show help                [boolean]
  -V, --version  Show version number      [boolean]

Examples

Running without a query:

$ araconf
{
  "network": {
    "identity": {}
  },
  "data": {
    "root": "/home/werle/.ara"
  },
  "web3": {
    "provider": "http://127.0.0.1:8545"
  }
}

Targeting the .data object of the conf:

$ araconf .data
{
  "root": "/home/werle/.ara"
}

Targeting the .web3.provider property:

$ araconf .web3.provider
"http://127.0.0.1:8545"

Enable debug output with --debug:

$ araconf .data.root --debug
  ara-runtime-configuration config: /home/werle/.ararc +0ms
  ara-runtime-configuration configs: [ '/home/werle/.ararc' ] +2ms
"/home/werle/.ara"

Contributing

Releases follow Semantic Versioning

See Also

License

LGPL-3.0

Keywords

ara

FAQs

Package last updated on 30 Mar 2021

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