# pull-serializer

> de/serialize pull streams

Latest version **0.3.2** (published 2015-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install pull-serializer
pnpm add pull-serializer
yarn add pull-serializer
bun add pull-serializer
```

## 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.3.2 |
| Published | 2015-02-16 |
| First published | 2014-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Paul Frazee |
| Maintainers | pfraze |

## Links

- npm: https://www.npmjs.com/package/pull-serializer
- Repository: https://github.com/pfraze/pull-serializer
- Issues: https://github.com/pfraze/pull-serializer/issues
- npm.io page: https://npm.io/package/pull-serializer

## Dependencies (2)

- [pull-split](https://npm.io/package/pull-split.md) ~0.1.2
- [pull-stream](https://npm.io/package/pull-stream.md) ~2.26.0

## Recent versions

- 0.3.2 (latest) — 2015-02-16
- 0.3.1 — 2014-10-19
- 0.3.0 — 2014-10-19
- 0.2.0 — 2014-10-17
- 0.1.1 — 2014-10-17
- 0.1.0 — 2014-10-17

## README

# pull-serializer

Serializes and parses pull-streams, eg for sending over a channel.

Takes a duplex pull-stream and returns a wrapped version which will emit/consume the serialized format. The second parameter optionally takes an object with `{stringify: Function, parse: Function}` defined (the `JSON` signature). The third parameter optionally takes flags `{ignoreErrors: Boolean, separator: String}`.

 - `ignoreErrors`: if true, bad JSON is filtered out and not emitted. If false (default) parse errors are emitted as `Error` objects
 - `separator`: sets the string to separate messages with (default '\n')

```js
var serializer = require('pull-serializer')

var theduplex = serializer({
  source: pull.values([5, "foo", [1,2,3], {hello: 'world'}]),
  sink: pull.collect(console.log) // => false [5, "foo", [1,2,3], {hello: 'world'}]
})

pull(
  theduplex,
  pull.map(function(chunk) {
    assert(typeof chunk == 'string')
    return chunk
  }),
  theduplex
)
```

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