JSLOB
JS Large OBject - The lazy way to work with JSON that won't fit in memory
Status: Alpha. Working but not stable.
Usage
const JSLOB = !{ let jslob = await JSLOB let output = await JSLOB console // {"foo":"bar"} console //bar } !{ let jslob = await JSLOB console JSLOB }
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 | 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}} |