# ndjson-to-observable

> Create an observable stream from a ndjson stream

Latest version **1.1.0** (published 2020-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install ndjson-to-observable
pnpm add ndjson-to-observable
yarn add ndjson-to-observable
bun add ndjson-to-observable
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-06-22 |
| First published | 2019-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 3 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Simon Jang |
| Maintainers | simonja |
| Keywords | streams, ndjson, observable, rxjs, io |

## Links

- npm: https://www.npmjs.com/package/ndjson-to-observable
- Repository: https://github.com/SimonJang/ndjson-to-observable
- Homepage: https://github.com/SimonJang/ndjson-to-observable#readme
- Issues: https://github.com/SimonJang/ndjson-to-observable/issues
- npm.io page: https://npm.io/package/ndjson-to-observable

## Dependencies (3)

- [split](https://npm.io/package/split.md) ^1.0.1
- [strip-bom-stream](https://npm.io/package/strip-bom-stream.md) ^4.0.0
- [@samverschueren/stream-to-observable](https://npm.io/package/@samverschueren/stream-to-observable.md) ^0.3.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-06-22
- 1.0.2 — 2020-03-02
- 1.0.1 — 2019-11-26
- 1.0.0 — 2019-11-19

## README

# ndjson-to-observable ![CI](https://github.com/SimonJang/ndjson-to-observable/workflows/CI/badge.svg?branch=master)

Transform a NDJSON stream to an [RxJS](https://www.npmjs.com/package/rxjs) observable stream.

## Requirements

 - [RxJS](https://www.npmjs.com/package/rxjs)
 - Node 8+

## Install

```
$ npm install ndjson-to-observable
```

## Usage

```js
import * as fs from 'fs';
import * as path from 'path'
import {ndjsonToObservable} from 'ndjson-to-observable';
import {tap} from 'rxjs/operators'

const stream = fs.createReadStream(path.join(__dirname, 'test.json'));

ndjsonToObservable(stream)
	.pipe(
		tap(item => console.log(item)) // JSON object
	)
	.subscribe()

```

## API

### ndjsonToObservable(stream)

#### stream

Type: `ReadableStream`

Stream of [NDJSON](http://ndjson.org/) records. Could be from a file or generated ad hoc.

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