# kubernetes-stream

> Streaming Kubernetes events

Latest version **2.0.0** (published 2018-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install kubernetes-stream
pnpm add kubernetes-stream
yarn add kubernetes-stream
bun add kubernetes-stream
```

## 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.0.0 |
| Published | 2018-01-05 |
| First published | 2017-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.0 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Josh Leder |
| Maintainers | slushie |
| Keywords | kubernetes, stream |

## Links

- npm: https://www.npmjs.com/package/kubernetes-stream
- npm.io page: https://npm.io/package/kubernetes-stream

## Dependencies (6)

- [chai](https://npm.io/package/chai.md) ^4.1.1
- [axios](https://npm.io/package/axios.md) ^0.17.1
- [debug](https://npm.io/package/debug.md) ^2.6.8
- [mocha](https://npm.io/package/mocha.md) ^3.5.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [js-yaml](https://npm.io/package/js-yaml.md) latest

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-01-05
- 1.1.0 — 2017-12-18
- 1.0.3 — 2017-12-16
- 1.0.2 — 2017-12-15
- 1.0.1 — 2017-10-09
- 1.0.0 — 2017-10-09

## README

# kubernetes-stream

This package provides a Node.js Streams API around Kubernetes events.

## Install

```
npm install kubernetes-stream
```

## Usage

```javascript
const Transform = require('stream').Transform
const KubernetesStream = require('kubernetes-stream')

// pipe the k8s events into a storage fifo
new KubernetesStream().pipe(
  new Transform({
    transform (event, encoding, callback) {
      const { type, object } = event
      const objectName = object.metadata.name

      if (!this.store) {
        this.store = {}
      }

      switch (type) {
        case 'Added':
        case 'Updated':
          this.store[objectName] = object
          break
        case 'Deleted':
          delete this.store[objectName]
          break
        default:
          return callback(new Error(`Can't handle ${type} event`))
      }

      return callback(null, event)
    }
  })
)
```

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