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
-
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
env: Environment
Returns string
the path to the daemon binary
setDaemonBinPath()
Arguments
env: Environment
-
path: string
: the path to the daemon binary
getDaemonSocketPath()
Arguments
env: Environment
Returns string
the socket path
setDaemonSocketPath()
Arguments
env: Environment
-
path: string
: the socket path
License
MIT