|
2 years ago | |
---|---|---|
lib | 2 years ago | |
test | 2 years ago | |
.gitignore | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
example.yaml | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago | |
util.js | 2 years ago | |
yarn.lock | 2 years ago |
Stores and retrieves a YAML configuration file for use with the cobox stack.
const Config = require('cobox-config')
const crypto = require('cobox-crypto') // or some other crypto scheme
var storage = './storage'
var config = Config(storage)
config.save()
Write to YAML storage, path set using the storage path when initialising. Make sure you call this otherwise the config will not write to disk.
config.load()
Load from YAML, path set using the storage path when initialising. This is called automatically when initialising a Config
.
config.identities.add(identity)
Append an identity to the config
var key = identity.name || identity.publicKey || identity.publicKey.toString('hex')
config.identities.remove(key)
Remove an identity from the config
var key = group.name || group.publicKey || group.publicKey.toString('hex')
config.groups.remove(group)
Remove a group from the config
config.identities.list()
List saved identities
config.groups.list()
List saved groups