# datahub-nodejs-sdk

> DataHub Node.js SDK

Latest version **2.2.1** (published 2019-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install datahub-nodejs-sdk
pnpm add datahub-nodejs-sdk
yarn add datahub-nodejs-sdk
bun add datahub-nodejs-sdk
```

Provides the command `datahub-nodejs-sdk`.

## 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.1 |
| Published | 2019-08-22 |
| First published | 2017-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | xudafeng, zivyangll, zyhack |
| Keywords | datahub, client |

## Links

- npm: https://www.npmjs.com/package/datahub-nodejs-sdk
- Repository: https://github.com/macacajs/datahub-nodejs-sdk
- Homepage: https://github.com/macacajs/datahub-nodejs-sdk#readme
- Issues: https://github.com/macacajs/datahub-nodejs-sdk/issues
- npm.io page: https://npm.io/package/datahub-nodejs-sdk

## Dependencies (1)

- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) 2

## 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.1 (latest) — 2019-08-22
- 2.2.0 — 2019-02-22
- 2.0.3 — 2018-11-09
- 2.0.0 — 2018-08-03
- 1.1.0 — 2018-07-26
- 1.0.10 — 2018-05-07
- 1.0.9 — 2018-05-07
- 1.0.8 — 2018-05-07
- 1.0.7 — 2018-03-20
- 1.0.6 — 2018-03-01
- 1.0.5 — 2018-02-05
- 1.0.4 — 2018-02-05
- 1.0.3 — 2018-02-03
- 1.0.2 — 2018-01-03
- 1.0.1 — 2017-12-25
- … 3 more at https://npm.io/package/datahub-nodejs-sdk/versions

## README

# datahub-nodejs-sdk

---

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/datahub-nodejs-sdk.svg?style=flat-square
[npm-url]: https://npmjs.org/package/datahub-nodejs-sdk
[travis-image]: https://img.shields.io/travis/macacajs/datahub-nodejs-sdk.svg?style=flat-square
[travis-url]: https://travis-ci.org/macacajs/datahub-nodejs-sdk
[codecov-image]: https://img.shields.io/codecov/c/github/macacajs/datahub-nodejs-sdk.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/macacajs/datahub-nodejs-sdk/branch/master
[node-image]: https://img.shields.io/badge/node.js-%3E=_8-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/datahub-nodejs-sdk.svg?style=flat-square
[download-url]: https://npmjs.org/package/datahub-nodejs-sdk

> DataHub Node.js SDK

<!-- GITCONTRIBUTOR_START -->

## Contributors

|[<img src="https://avatars1.githubusercontent.com/u/2139038?v=4" width="100px;"/><br/><sub><b>zhangyuheng</b></sub>](https://github.com/zhangyuheng)<br/>|[<img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars1.githubusercontent.com/u/11460601?v=4" width="100px;"/><br/><sub><b>zivyangll</b></sub>](https://github.com/zivyangll)<br/>|
| :---: | :---: | :---: |


This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Fri Feb 15 2019 23:07:40 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->

## Installment

```bash
$ npm i datahub-nodejs-sdk --save-dev
```

## Common Usage

```javascript
import DataHubSDK from 'datahub-nodejs-sdk';

const sdkClient = new DataHubSDK();

// switch currentScene for 'POST api/create' to 'sucess'
await sdkClient.switchScene({
  hub: 'app',
  pathname: 'api/create',
  scene: 'success',
  method: 'POST',   // method is optional, default method is 'ALL'
})

// switch currentScene for 'GET api/read' to 'success'
// switch currentScene for 'DELETE api/delete' to 'success'
await sdkClient.switchMultiScenes([{
  hub: 'app',
  pathname: 'api/read',
  scene: 'success',
  method: 'GET',   // method is optional, default method is 'ALL'
}, {
  hub: 'app',
  pathname: 'api/delete',
  scene: 'success',
  method: 'DELETE',  // method is optional, default method is 'ALL'
}])

// switch all scenes for all pathnames under app to 'success'
await sdkClient.switchAllScenes({
  hub: 'app',
  scene: 'success',
})
```

## [API Documents](//macacajs.github.io/datahub-nodejs-sdk/)

## License

The MIT License (MIT)

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