port of hapijs confidence, specifically the store module(majority of the functionality) with just lodash as a dependency
npm install conf-store


import ConfStore from 'conf-store'const config = {
apiKey: {
"$filter": "env",
"development": "asdfasdf",
"staging": "asfasdf",
"production": "asfdasd"
}
}
const store = new Store(config)
const manifest = store.get('/', { env: process.env.NODE_ENV })
export default manifest
//manifest is an object filtered by NODE_ENV in this example
`
$3
A cli is also available in order to export a filtered store to a json file to use in a client side app for example consumed by webpack.in pakage.json scripts block:
`
build-config: confStore fixtures/store.js -p '/' -f env=$NODE_ENV -o dist/config.json
`the first arugment is the path to the module that exports the unfiltered store.
`
import ConfStore from 'conf-store'const config = {
apiKey: {
"$filter": "env",
"development": "asdfasdf",
"staging": "asfasdf",
"production": "asfdasd"
}
}
const store = new Store(config)
export default store
`-p arg is the path you want to get from the store to export.
-f is the filter you want to apply. it will be converted to
`
{ env: 'development'}
``to be applied against the store
-o is where the file should be output.