@mainframe/config
Shared local configuration for Mainframe packages.
Last updated 2 years ago by aclarke .
MIT · Original npm · Tarball · package.json
$ cnpm install @mainframe/config 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.0                                ...           latest (2 years ago)

2 Versions

  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |