# sofa-registry-node

> Node.js SDK for SOFARegistry

Latest version **0.0.1** (published 2019-10-10) · 0 weekly downloads

## Install

```sh
npm install sofa-registry-node
pnpm add sofa-registry-node
yarn add sofa-registry-node
bun add sofa-registry-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-10-10 |
| First published | 2019-07-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 6 |
| Unpacked size | 58.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | killagu |
| Maintainers | gxcsoccer, killagu |
| Keywords | Registry, node |

## Links

- npm: https://www.npmjs.com/package/sofa-registry-node
- Repository: https://github.com/sofa/sofa-registry-node
- Homepage: https://github.com/sofastack/sofa-registry-node#readme
- Issues: http://github.com/sofa/sofa-registry-node/issues
- npm.io page: https://npm.io/package/sofa-registry-node

## Dependencies (6)

- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [sdk-base](https://npm.io/package/sdk-base.md) ^3.6.0
- [mz-modules](https://npm.io/package/mz-modules.md) ^2.1.0
- [await-first](https://npm.io/package/await-first.md) ^1.0.0
- [cluster-client](https://npm.io/package/cluster-client.md) ^3.0.1
- [sofa-bolt-node](https://npm.io/package/sofa-bolt-node.md) ^1.2.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2019-10-10
- 0.0.0 — 2019-07-12

## README

# sofa-registry-node

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[snyk-image]: https://snyk.io/test/npm/sofa-registry-node/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/sofa-registry-node
[download-image]: https://img.shields.io/npm/dm/sofa-registry-node.svg?style=flat-square
[download-url]: https://npmjs.org/package/sofa-registry-node

Node.js SDK for SOFARegistry

## Usage
```js
const httpclient = require('urllib');
const { RegistryType, RegistryClient } = require('sofa-registry-node');
const client = new RegistryClient({
  config: {
    endpoint: '127.0.0.1',
    port: 9603,
    env: 'sit',
    zone: 'DEFAULT_ZONE',
    dataCenter: 'test',
    appname: 'foo',
    instanceId: 'bar',
    recheckInterval: 500,
  },
  logger: console,
  httpclient,
});

// publish data
client.register({
  dataId,
  group: 'DEFAULT',
  appname: 'chair-test',
}, 'test_val', 'test_val2');

// subscribe data
client.subscribe({
  dataId,
  group: 'DEFAULT',
  appname: 'chair-test',
  scope: 'zone',
}, data => {
  subData = data;
});

// subscribe config data
client.subscribeConfig({
  dataId,
  group: 'DEFAULT',
  appname: 'chair-test',
}, data => {
  confData = data;
});

```

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