1.0.1 • Published 5 years ago

@hest-lab/plugin-configstore v1.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 years ago

Configstore plugin

pipeline status coverage report

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()
1.0.1

5 years ago

1.0.0

5 years ago