New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@edgeros/eldb-client

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@edgeros/eldb-client

latest
npmnpm
Version
1.0.3
Version published
Maintainers
0
Created
Source

@edgeros/eldb-client

@edgeros/eldb-client is an etcdshim, similar to @edgeros/etcd3 support etcd and sqlite as persistent engine.

sqlite will be supported in v2

  • Support api:

    KV Lease Watch

Quickstart

  • Install
npm install --save @edgeros/eldb-client 
  • Usage

kv,watch,lease api is like etcd3

// etcd
import { DBClient } from '@edgeros/eldb-client'

async function foo () {
  const options = {
    etcd: {
      hosts: '10.12.0.204:2379'
    }
  }
  const client =  new DBClient(options)
  await client.init()
  // kv
  await client.put('foo1').value('bar1'),
  await client.put('foo2').value('bar2'),
  await client.put('foo3').value('{"value":"bar3"}'),
  console.log(await client.get('foo1').string())
  console.log(await client.get('foo2').buffer())
  console.log(await client.get('foo3').json())

  // lease
  const lease = client.lease(100)
  await lease.put('leased').value('foo')
  await lease.revoke()

  // watch
  const watcher = await client.watch().key('foo1').watcher()
  watcher.on('connecting', () => console.log('connecting'))
  watcher.on('connected', () => console.log('connected'))
  watcher.on('put', (kv) => console.log('put', kv))
  watcher.on('delete', (kv) => console.log('delete', kv))
  await watcher.cancel()

  client.close()
}


Versions

  • v1: support etcd (✔)
  • v2: support sqlite (...)
  • v3: support db compact (...)

FAQs

Package last updated on 16 Jan 2025

Did you know?

Socket

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