# jslob

> JS Large OBject - The lazy way to work with JSON that won't fit in memory

Latest version **0.2.0** (published 2018-12-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install jslob
pnpm add jslob
yarn add jslob
bun add jslob
```

## 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.2.0 |
| Published | 2018-12-31 |
| First published | 2018-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fabio Beltramini |
| Maintainers | fabiocbinbutter |
| Keywords | JSON, disk, memory, streaming |

## Links

- npm: https://www.npmjs.com/package/jslob
- Repository: https://github.com/fabiocbinbutter/jslob
- Homepage: https://github.com/fabiocbinbutter/jslob#readme
- Issues: https://github.com/fabiocbinbutter/jslob/issues
- npm.io page: https://npm.io/package/jslob

## Dependencies (4)

- [jsonparse](https://npm.io/package/jsonparse.md) ^1.3.1
- [leveldown](https://npm.io/package/leveldown.md) ^4.0.1
- [level-packager](https://npm.io/package/level-packager.md) ^4.0.1
- [lexicographic-integer](https://npm.io/package/lexicographic-integer.md) ^1.1.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-12-31
- 0.1.0 — 2018-12-31
- 0.0.2 — 2018-12-26
- 0.0.1 — 2018-12-26

## README

# JSLOB

*JS Large OBject - The lazy way to work with JSON that won't fit in memory*

**Status:** Alpha. Working but not stable.

### Usage

```js
const JSLOB = require('jslob')()

!async function smallExample(){
	let jslob = await JSLOB.parse('{"foo":"bar"}')
	let output = await JSLOB.stringify(jslob)
	console.log(output) // {"foo":"bar"}
	console.log(await jslob.foo) //bar
	}()

!async function bigExample(){
	let jslob = await JSLOB.parse(fs.createReadStream('package.json'))
	console.log(await jslob.dependencies.jslob)
	JSLOB.streamify(jslob).on("data",chunk=>console.log(chunk))
	}()
```

### Features / API

|Feature | Description | Status | API |
|---|---|---|---|
|Parse String | Parse a (potentially huge) JSON string | Working | await JSLOB.parse('{}') |
|Parse Stream | Parse a (potentially huge) JSON stream | Working | await JSLOB.parse(readable) |
|String Out | String out JSON from a JSLOB | Working | await JSLOB.stringify(jslob) |
|Stream Out | Stream out JSON from a JSLOB | Working | JSLOB.streamify(jslob) |
|Getters | Transparently get properties | Working | jslob.foo //bar |
|Setters | Transparently set properties | TODO | jslob.foo = "baz" |
|Iterators+ | Enumerate, iterate, splat, etc | TODO | JSLOB.entries(jslob) & more |
|Destroy | Manually clean up expired objects | TODO | JSLOB.del(jslob) |
|GC | Automatically clean up expired objects | [Not currently  possible](https://github.com/tc39/proposal-weakrefs/issues/55) | N/A |
|Storage | Use any leveldown-compliant storage | Untested | const JSLOB = require('jslob')({leveldown:...}) |
|Type-mutating property re-use | The following JSON may return unexpected results | TODO | {"foo":[1],"foo":{"x":2}} |

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