# hemera-snappy

> This is a plugin to use snappy compression with Hemera

Latest version **1.0.1** (published 2017-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install hemera-snappy
pnpm add hemera-snappy
yarn add hemera-snappy
bun add hemera-snappy
```

## 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 | 1.0.1 |
| Published | 2017-10-03 |
| First published | 2017-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 808 |
| Author | Dustin Deus |
| Maintainers | starptech |

## Links

- npm: https://www.npmjs.com/package/hemera-snappy
- Repository: https://github.com/hemerajs/hemera
- Homepage: https://github.com/hemerajs/hemera#readme
- Issues: https://github.com/hemerajs/hemera/issues
- npm.io page: https://npm.io/package/hemera-snappy

## Dependencies (2)

- [snappyjs](https://npm.io/package/snappyjs.md) 0.5.x
- [hemera-plugin](https://npm.io/package/hemera-plugin.md) ^0.0.14

## Recent versions

- 1.0.1 (latest) — 2017-10-03
- 1.0.0 — 2017-10-03
- 0.1.1 — 2017-08-01
- 0.1.0 — 2017-07-31
- 0.0.13 — 2017-07-08
- 0.0.12 — 2017-07-06
- 0.0.11 — 2017-07-06
- 0.0.10 — 2017-06-27
- 0.0.9 — 2017-06-21
- 0.0.8 — 2017-06-21
- 0.0.7 — 2017-06-20
- 0.0.6 — 2017-06-20
- 0.0.5 — 2017-06-05
- 0.0.4 — 2017-06-04
- 0.0.3 — 2017-06-04
- … 2 more at https://npm.io/package/hemera-snappy/versions

## README

# Hemera-snappy package

[![npm](https://img.shields.io/npm/v/hemera-snappy.svg?maxAge=3600)](https://www.npmjs.com/package/hemera-snappy)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](#badge)

This is a plugin to use [Google Snappy](https://github.com/google/snappy) with Hemera.

Snappy is a compression/decompression library. It does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression.


#### Example

```js
'use strict'

const Hemera = require('nats-hemera')
// Use NATS driver >= 0.7.2
const nats = require('nats').connect({ 
  // otherwise NATS will interpret all data as LATIN1 (binary encoding)
  preserveBuffers: true
})
const HemeraSnappy = require('hemera-snappy')

const hemera = new Hemera(nats, {
  logLevel: 'info'
})

hemera.use(HemeraSnappy)

hemera.ready(() => {
  hemera.add({
    topic: 'math',
    cmd: 'add'
  }, (req, cb) => {

    cb(null, req.a + req.b)
  })

  hemera.act({
    topic: 'math',
    cmd: 'add',
    a: 1,
    b: 20
  }, function (err, resp) {

    this.log.info('Result', resp)
  })
})

```

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