Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
configstore-fork
Advanced tools
Easily load and save config without having to think about where and how
This fork only contains minor differences:
This fork is not meant to be a general replacement for configstore. It was solely created to solve issues relating to the changes above. All credit for this package should go to the original authors.
Easily load and persist config without having to think about where and how
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.
const Configstore = require('configstore');
const pkg = require('./package.json');
// create a Configstore instance with an unique ID e.g.
// Package name and optionally some default values
const conf = new Configstore(pkg.name, {foo: 'bar'});
console.log(conf.get('foo'));
//=> 'bar'
conf.set('awesome', true);
console.log(conf.get('awesome'));
//=> true
// Use dot-notation to access nested properties
conf.set('bar.baz', true);
console.log(conf.get('bar'));
//=> {baz: true}
conf.delete('awesome');
console.log(conf.get('awesome'));
//=> undefined
Returns a new instance.
Type: string
Name of your package.
Type: Object
Default config.
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.
You can use dot-notation in a key
to access nested properties.
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 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.
Get all the config as an object or replace the current config with an object:
conf.all = {
hello: 'world'
};
BSD license
Copyright Google
FAQs
Easily load and save config without having to think about where and how
We found that configstore-fork demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.