Socket
Socket
Sign inDemoInstall

cobox-config

Package Overview
Dependencies
11
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cobox-config

load and save a cobox configuration


Version published
Maintainers
2
Created

Readme

Source

cobox-config

Stores and retrieves a YAML configuration file for use with the cobox stack. Also loads up master key to generate a global identity.

Example

const Config = require('cobox-config')
const crypto = require('cobox-crypto')() // or some other crypto scheme

var storage = './storage'
var config = Config(storage)

API

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.

var key = group.name || group.address || group.address.toString('hex')
config.groups.get(group)

Get a group from the config

var key = group.name || group.address || group.address.toString('hex')
config.groups.set(group, { name, address, encryptionKey })

Add a group to the config

var key = group.name || group.address || group.address.toString('hex')
config.groups.delete(group)

Remove a group from the config

config.groups.list()

List saved groups

Future Features

  • Store names against ID's in YAML config file for multiple identity capability

Keywords

FAQs

Last updated on 11 Feb 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc