configstore alternatives and similar modules
Based on the "Command Line Utilities" category.
Alternatively, view configstore alternatives based on common mentions on social networks and blogs.
-
nvm
Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions -
Inquirer.js
A collection of common interactive command line user interfaces. -
KeyboardJS
A JavaScript library for binding keyboard combos without the pain of key codes and key combo conflicts. -
omelette
Omelette is a simple, template based autocompletion tool for Node and Deno projects with super easy API. (For Bash, Zsh and Fish) -
log-update
Log by overwriting the previous output in the terminal. Useful for rendering progress bars, animations, etc. -
insight
Node.js module to help you understand how your tool is being used by anonymously reporting usage metrics to Google Analytics -
columnify
Create text-based columns suitable for console output. Supports cell wrapping. -
string-width
Get the visual width of a string - the number of columns required to display it -
loud-rejection
Make unhandled promise rejections fail loudly instead of the default silent fail -
multispinner
Multiple, simultaneous, individually controllable spinners for concurrent tasks in Node.js CLI programs -
sudo-block
Block users from running your app with root permissions -
googleauth
Create and load persistent Google authentication tokens for command-line apps -
licenseye
Node.js CLI tool to visualize an aggregate list of your dependencies' licenses -
cron-to-quartz
Node.js library to convert unix or linux CRON syntax to Quartz Scheduler
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of configstore or a related project?
README
configstore 
Easily load and persist config without having to think about where and how
The config is stored in a JSON file located in $XDG_CONFIG_HOME
or ~/.config
.
Example: ~/.config/configstore/some-id.json
If you need this for Electron, check out electron-store
instead.
And check out conf
for an updated approach to this concept.
Install
$ npm install configstore
Usage
const Configstore = require('configstore');
const packageJson = require('./package.json');
// Create a Configstore instance
const config = new Configstore(packageJson.name, {foo: 'bar'});
console.log(config.get('foo'));
//=> 'bar'
config.set('awesome', true);
console.log(config.get('awesome'));
//=> true
// Use dot-notation to access nested properties
config.set('bar.baz', true);
console.log(config.get('bar'));
//=> {baz: true}
config.delete('awesome');
console.log(config.get('awesome'));
//=> undefined
API
Configstore(packageName, defaults?, options?)
Returns a new instance.
packageName
Type: string
Name of your package.
defaults
Type: object
Default config.
options
Type: object
globalConfigPath
Type: boolean
Default: false
Store the config at $CONFIG/package-name/config.json
instead of the default $CONFIG/configstore/package-name.json
. This is not recommended as you might end up conflicting with other tools, rendering the "without having to think" idea moot.
configPath
Type: string
Default: Automatic
Please don't use this option unless absolutely necessary and you know what you're doing.
Set the path of the config file. Overrides the packageName
and globalConfigPath
options.
Instance
You can use dot-notation in a key
to access nested properties.
.set(key, value)
Set an item.
.set(object)
Set multiple items at once.
.get(key)
Get an item.
.has(key)
Check if an item exists.
.delete(key)
Delete an item.
.clear()
Delete all items.
.size
Get the item count.
.path
Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them.
.all
Get all the config as an object or replace the current config with an object:
config.all = {
hello: 'world'
};
Get professional support for this package with a Tidelift subscription Tidelift helps make open source sustainable for maintainers while giving companiesassurances about security, maintenance, and licensing for their dependencies.