package
Simple dotless config handling for your app or module
npm install dotless-confGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Hard fork of sindresorhus's "conf" in order to remove dot props
Simple config handling for your app or module
All you have to care about is what to persist. This module will handle all the dull details like where and how.
$ npm install --save dotless-confconst Conf = require('dotless-conf');
const config = new Conf();
config.set('unicorn', '🦄');
console.log(config.get('unicorn'));
//=> '🦄'
// use dot-notation to access nested properties
config.set('foo.bar', true);
console.log(config.get('foo'));
//=> {bar: true}
config.delete('unicorn');
console.log(config.get('unicorn'));
//=> undefinedWhen reading and writing an object to a file, you don't always want to support nested object properties
// with "conf"
// use dot-notation to access nested properties
config.set('foo.bar', true);
console.log(config.get('foo'));
//=> {bar: true}
// with "dotless-conf"
config.set('foo.bar', true);
console.log(config.get('foo'));
//=> undefined
console.log(config.get('foo.bar'));
//=> trueReturns a new instance.
Type: Object
Default config.
Type: string
Default: config
Name of the config file (without extension).
Useful if you need multiple config files for your app or module. For example, different config files between two major versions.
Type: string
Default: The name field in your package.json
You only need to specify this if you don't have a package.json file in your project.
Type: string
Default: System default user config directory
You most likely don't need this.
Overrides projectName.
The only use-case I can think of is having the config located in the app directory or on some external storage.
The instance is iterable so you can use it directly in a for…of loop.
Set an item.
Set multiple items at once.
Get an item.
Check if an item exists.
Delete an item.
Delete all items.
Get the item count.
Get all the config as an object or replace the current config with an object:
conf.store = {
hello: 'world'
};Get the path to the config file.
MIT © Dawson Botsford
Estimated unpacked size across 11 packages.
266.2 kB
Includes dependencies.
5 direct · 5 outdated
^0.5.1
3.0.1
^2.0.0
5.0.0
^1.2.0
5.1.0
^0.3.0
4.0.0
^2.3.0
8.0.0