# simple-consul

> Simple consul aims to simplify the consul experience on node

Latest version **0.0.3** (published 2019-06-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install simple-consul
pnpm add simple-consul
yarn add simple-consul
bun add simple-consul
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-06-16 |
| First published | 2019-06-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Bjarte Klyve Larsen |
| Maintainers | klyve |

## Links

- npm: https://www.npmjs.com/package/simple-consul
- Repository: https://github.com/klyve/simple-consul
- Homepage: https://github.com/klyve/simple-consul#readme
- Issues: https://github.com/klyve/simple-consul/issues
- npm.io page: https://npm.io/package/simple-consul

## Dependencies (1)

- [consul](https://npm.io/package/consul.md) ^0.34.1

## Recent versions

- 0.0.3 (latest) — 2019-06-16
- 0.0.2 — 2019-06-16
- 0.0.1 — 2019-06-16

## README

# SimpleConsul
The goal is to simplify the usage of consul in your nodeJS application

This is currently a work in progress project, and improvements are to come

## Consul support
- Register
- Deregister
- Get key value


## Usage

Connecting to the instance
```
const consul = new SimpleConsul({
  host: "consul",
  name: "Name"
});
```

Registering the service
```
consul.register();
```

De-Registering the service
```
consul.deregister();
```

fetching value from key within a folder
```
consul.get("key", "namespace")
.then(key => console.log(key)) // {key: value}
.catch(err => console.log(err));
```

fetching multiple keys
```
consul.get(["key", "key1", "key2"])
.then(key => console.log(key)) // {key: value, key1: value}
.catch(err => console.log(err));
```

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