1.0.0 • Published 5 years ago
config-mock v1.0.0
config-mock
mock for https://www.npmjs.com/package/config
Why
You can just specify a /config/test.json I realize but sometimes you want to try a bunch of configs, this lets you progmatically create configs.
Usage
npm i config-mock
// Require
var configMock = require('config-mock');
// Create a mock
var mockConfig = configMock({
foo: 'foo'
});
// Use as usual
mockConfig.get('foo')
Any path not specified in your actual ./config/default.json will still throw an error even if you add it in the mock.
1.0.0
5 years ago