# bletcd

> A minimalistic etcd client

Latest version **2.2.0** (published 2015-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install bletcd
pnpm add bletcd
yarn add bletcd
bun add bletcd
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2015-01-14 |
| First published | 2014-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Hugo Wetterberg |
| Maintainers | hugowetterberg |
| Keywords | etcd, rest, client |

## Links

- npm: https://www.npmjs.com/package/bletcd
- Repository: https://github.com/bloglovin/bletcd
- Issues: https://github.com/bloglovin/bletcd/issues
- npm.io page: https://npm.io/package/bletcd

## Dependencies (1)

- [verror](https://npm.io/package/verror.md) ^1.6.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2015-01-14
- 2.1.0 — 2015-01-14
- 2.0.0 — 2014-12-10
- 1.0.2 — 2014-08-11
- 1.0.1 — 2014-07-30
- 1.0.0 — 2014-07-29

## README

# bletcd - The Bloglovin' etcd client

Bletcd is a minimalistic etcd client with convenient functionality for watching for changes.

# Usage

```js
var client = bletcd({
  url: 'http://127.0.0.1:4001',
});

var watcher = client.watcher('test/other-key');
watcher.on('error', function(err) {
  console.error('Watch error:', err);
  watcher.stop();
});
watcher.on('change', function(op) {
  console.log('Notified of change:', op);
});

client.put('test/other-key', 'a-value', function(err, response) {
  if (err) {
    console.error('Failed to write value', err);
    watcher.stop();
    return;
  }
  console.log('Wrote a value to etcd');

  client.get('test/other-key', function(err, response) {
    if (err) {
      console.error('Failed to fetch value', err);
    }
    else {
      console.log('Successfully fetched the key value:', response.node.value);
    }

    client.delete('test/other-key', function(err) {
      if (err) {
        console.error('Failed to delete value:', err);
      }
      else {
        console.log('Successfully deleted value');
      }
      watcher.stop();
    });
  });
});
```

Output:
```txt
Notified of change: { action: 'set',
  node:
   { key: '/test/other-key',
     value: 'a-value',
     modifiedIndex: 537,
     createdIndex: 537 } }
Wrote a value to etcd
Successfully fetched the key value: a-value
Notified of change: { action: 'delete',
  node: { key: '/test/other-key', modifiedIndex: 538, createdIndex: 537 },
  prevNode:
   { key: '/test/other-key',
     value: 'a-value',
     modifiedIndex: 537,
     createdIndex: 537 } }
Successfully deleted value
```

---
_Source: https://npm.io/package/bletcd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
