Ensure
|| Ensure.throws this makes sure that process.exit(1) happens because something is wrong with our environment
Static Method Summary
Static Public Methods | ||
public static |
env(key: <type>): * checks to ensure an environment variable is set |
|
public static |
error(msg: <type>) generates an error with |
|
public static |
executable(exe: String): String makes sure a given executable/bin can be found in our environment |
|
public static |
throws(err: <type>) throws |
Static Public Methods
public static env(key: <type>): * source
checks to ensure an environment variable is set
Params:
Name | Type | Attribute | Description |
key | <type> | The environment variable to check for |
Return:
* |
public static error(msg: <type>) source
generates an error with msg
and throws it
Params:
Name | Type | Attribute | Description |
msg | <type> | The msg |
public static executable(exe: String): String source
makes sure a given executable/bin can be found in our environment
Params:
Name | Type | Attribute | Description |
exe | String | The executable we need |
public static throws(err: <type>) source
throws
Params:
Name | Type | Attribute | Description |
err | <type> | The err |
Example:
const required_value = config.thing || Ensure.throws(`missing config.thing`)