appcore-config

1.1.0 • Public • Published

Appcore Config

Pulls configuration into an Appcore instance from the environment, the CLI and the file system.

process.env.CAKE = "yum!";
 
var app = Appcore();
 
app.use(require("@beneaththeink/appcore-config")({
    env: { CAKE: "foods.cake" }
}));
 
app.use(function() {
    console.log(this.get("foods.cake"));
});

Available options:

  • files - List of files to import as configuration. Currently accepted file types are HJSON, JavaScript and YAML.
  • filesKey - A key in the Appcore instance's options that will be merged with the files list. Useful if wanting to allow the end user to specify a config file.
  • cli - Minimist options for parsing the CLI. Set to false to disable CLI parsing.
  • env - An object of process.env properties mapped to Appcore option keys.

Readme

Keywords

Package Sidebar

Install

npm i appcore-config

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bti
  • mrgalaxy