# service-dog

> Teach you

Latest version **1.0.3** (published 2019-03-28) · MIT license · 13 weekly downloads

## Install

```sh
npm install service-dog
pnpm add service-dog
yarn add service-dog
bun add service-dog
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-03-28 |
| First published | 2019-03-26 |
| Weekly downloads | 13 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 55.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Benjamin Kniffler |
| Maintainers | bkniffler |
| Keywords | rpc, service, proxy, websocket, socket, electron, ipc, realtime, react-native, react |

## Links

- npm: https://www.npmjs.com/package/service-dog
- Repository: https://github.com/bkniffler/service-dog
- Homepage: https://github.com/bkniffler/service-dog#readme
- Issues: https://github.com/bkniffler/service-dog
- npm.io page: https://npm.io/package/service-dog

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.3

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-03-28
- 1.0.2 — 2019-03-28
- 1.0.1 — 2019-03-28
- 1.0.0 — 2019-03-27
- 1.0.0-alpha.4 — 2019-03-27
- 1.0.0-alpha.3 — 2019-03-27
- 1.0.0-alpha.2 — 2019-03-27
- 1.0.0-alpha.1 — 2019-03-27
- 1.0.0-alpha.0 — 2019-03-26

## README

<div align="center">
  <a href="https://github.com/bkniffler/service-dog">
    <img alt="alpacka" src="https://raw.githubusercontent.com/bkniffler/service-dog/master/assets/logo.png" height="250px" />
  </a>
</div>
<div align="center">
  <strong>Teach your service-dog whatever skills it needs and let it handle your requests.</strong>
  <br />
  <br />
  <a href="https://travis-ci.org/bkniffler/service-dog">
    <img src="https://img.shields.io/travis/bkniffler/service-dog.svg?style=flat-square" alt="Build Status">
  </a>
  <a href="https://codecov.io/github/bkniffler/service-dog">
    <img src="https://img.shields.io/codecov/c/github/bkniffler/service-dog.svg?style=flat-square" alt="Coverage Status">
  </a>
  <a href="https://github.com/bkniffler/service-dog">
    <img src="http://img.shields.io/npm/v/service-dog.svg?style=flat-square" alt="Version">
  </a>
  <a href="https://github.com/bkniffler/service-dog">
    <img src="https://img.shields.io/badge/language-typescript-blue.svg?style=flat-square" alt="Language">
  </a>
  <a href="https://github.com/bkniffler/service-dog/master/LICENSE">
    <img src="https://img.shields.io/github/license/bkniffler/service-dog.svg?style=flat-square" alt="License">
  </a>
  <a href="https://github.com/bkniffler/service-dog">
    <img src="https://flat.badgen.net/bundlephobia/minzip/service-dog" alt="License">
  </a>
  <br />
  <br />
</div>

# service-dog

Create flexible and extandable data flows by encapsulating operations into skills, making an ordered chain that can handle whatever request you throw at it. As soon as you send an action, service-dog will run through all of its skills, mutating the action's value along until it is done. Each skill can also hook into the return chain to modify the value on its way back. The executional interface to service-dog is based on promises, though internally, due to performance and flexibility, service-dog uses callbacks. Thus, it can easily handle async stuff like http requests, image transformation, etc.

Service-Dog is based a lot on the idea of middlewares (made popular by expressjs) but is completely agnostic to what kind of operations it handles. It is also inspired by redux, though only on the action/middleware part. It excels in cases where you'd work with class overwriting and/or hooks to allow extending some part of functionality. A classic example is a database with different adapters and plugins (like soft-delete, auditing, time-stamping), a server that can handle requests, an authentication/authorization system, an API client. Basically anything that has a strong focus on how data flows.

It can also help you check your flow by providing a tracker that will fire on start and completion of your chain and each time a skill is entered.

This library works on node and in the browser, has no dependencies except for tslib (no dependencies, 2kb gzipped) and is tree shackable.

## Docs

- [Documentation](https://bkniffler.github.io/service-dog/)
- [Typedoc](https://bkniffler.github.io/service-dog/typedoc)
- [CodeSandbox Playground](https://codesandbox.io/s/pp3zwnxk7m)

## Install

```
yarn add service-dog
npm i service-dog
```

### CDN

A browser version is available on https://cdn.jsdelivr.net/npm/service-dog

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