@mainframe/config

0.3.0 • Public • Published

Mainframe config

Shared local configuration for Mainframe packages.

Installation

yarn add @mainframe/config

Usage

The Environment class provides a namespaced persisted configuration and paths to be used.

All other functions need to be provided with an Environment instance they use to interact.

import { Environment, getDaemonSocketPath } from '@mainframe/config'

const env = new Environment('development')
const socketPath = getDaemonSocketPath(env)

API

new Environment()

Arguments

  1. name: string: name of the environment

Environment instance

.name

Returns string the environment name

.config

Returns Conf instance

.paths

Returns env paths shared by the platform

getDaemonBinPath()

Arguments

  1. env: Environment

Returns string the path to the daemon binary

setDaemonBinPath()

Arguments

  1. env: Environment
  2. path: string: the path to the daemon binary

getDaemonSocketPath()

Arguments

  1. env: Environment

Returns string the socket path

setDaemonSocketPath()

Arguments

  1. env: Environment
  2. path: string: the socket path

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @mainframe/config

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

33.2 kB

Total Files

18

Last publish

Collaborators

  • aclarke
  • diogoperillo
  • howleysv
  • mosic
  • paul_lecam
  • sarahwiley