@hest-lab/plugin-configstore
v1.0.1
Published
configstore plugin
Downloads
8
Readme
Configstore plugin
A typesafe wrapper for configstore.
Usage
// Create schema for the configuration
interface ISchema {
foo: string
bar: number
oh: {
dummy: string
}
}
// Create instance
const hc = new HestConfigstore<ISchema>('your-project-name')
// Set a value
hc.set('foo', 'Hello World')
// Get a value
const val: string = hc.get('foo')
// Check if a key exists
const exists: boolean = hc.has('foo')
// Delete a specific key
hc.delete('bar')
// Clear all keys
hc.clear()
// Get the item count
const count: number = hc.count()
// Get the path to the config file
const path: string = hc.path()