Skip to content

Releases

1.1.0

Choose a tag to compare

@lahmatiy lahmatiy released this 03 May 22:18
  • parseChunked():
    • Added returnValue and currentRootValue properties to the state object passed to onChunk and onRootValue callbacks
  • Exposed internal TypeScript types such as options and return types of public functions as part of the public API

1.0.0

Choose a tag to compare

@lahmatiy lahmatiy released this 09 Mar 21:28
  • parseChunked():
    • Refactored from class-based to function-based implementation, as a result a bit smaller and faster
    • Added reviver support (similar to JSON.parse()), both as a second argument (parseChunked(input, reviver)) and in options (parseChunked(input, { reviver }))
    • Added support for JSONL (NDJSON) mode, which allows parsing multiple JSON values from a stream of chunks, where each value is separated by a newline character, i.e. parseChunked(input, { mode }), where mode can be json (default), jsonl, or auto
    • Added onRootValue option for incremental stream processing, useful in JSONL mode, which is called with each parsed root value
    • Added onChunk option for progress tracking
    • When onRootValue is specified, parseChunked() returns number of processed root values instead of collecting and returning parsed values
    • Fixed OOM on very long arrays (corner case, millions of elements)
    • Fixed various issues with parsing of malformed JSON
  • stringifyChunked():
    • Added mode option with "json" (default) and "jsonl" values; mode: "jsonl" serializes iterable input into newline-delimited JSON values
  • stringifyInfo():
    • Added mode option with "json" (default) and "jsonl" values; mode: "jsonl" computes byte size for newline-delimited JSON values

0.6.3

Choose a tag to compare

@lahmatiy lahmatiy released this 24 Oct 21:24
  • Fixed an issue with types in the exports of package.json that introduced in version 0.6.2 (#14)

0.6.2

Choose a tag to compare

@lahmatiy lahmatiy released this 18 Oct 01:58
  • Added spaceBytes field to stringifyInfo() result, which indicates the number of bytes used for white spaces. This allows for estimating size of JSON.stringify() result with and without formatting (when space option is used) in a single pass instead of two
  • Fixed stringifyInfo() to correctly accept the space parameter from options, i.e. stringifyInfo(data, { space: 2 })

0.6.1

Choose a tag to compare

@lahmatiy lahmatiy released this 06 Aug 22:29
  • Enhanced the performance of stringifyChunked() by 1.5-3x
  • Enhanced the performance of stringifyInfo() by 1.5-5x
  • Fixed parseFromWebStream() to ensure that the lock on the reader is properly released

0.6.0

Choose a tag to compare

@lahmatiy lahmatiy released this 02 Jul 12:33
  • Added stringifyChunked() as a generator function
  • Added createStringifyWebStream() function
  • Added parseFromWebStream() function
  • Changed parseChunked() to accept an iterable or async iterable that iterates over string, Buffer, or TypedArray elements
  • Removed stringifyStream(), use Readable.from(stringifyChunked()) instead
  • Fixed conformance stringifyChunked() with JSON.stringify() when replacer a list of keys and a key refer to an entry in a prototype chain
  • stringifyInfo():
    • Aligned API with stringifyChunked by accepting options as the second parameter. Now supports:
      • stringifyInfo(value, replacer?, space?)
      • stringifyInfo(value, options?)
    • Renamed minLength field into bytes in functions result
    • Removed the async option
    • The function result no longer contains the async and duplicate fields
    • Fixed conformance with JSON.stringify() when replacer a list of keys and a key refer to an entry in a prototype chain
  • Discontinued exposing the version attribute
  • Converted to Dual Package, i.e. ESM and CommonJS support

0.5.7

Choose a tag to compare

@lahmatiy lahmatiy released this 20 Apr 10:46
  • Fixed adding entire package.json content to a bundle when target is a browser

0.5.6

Choose a tag to compare

@lahmatiy lahmatiy released this 30 Nov 22:06
  • Fixed stringifyStream() hang when last element in a stream takes a long time to process (#9, @kbrownlees)

0.5.5

Choose a tag to compare

@lahmatiy lahmatiy released this 14 Sep 23:27
  • Added missed TypeScript typings file into the npm package

0.5.4

Choose a tag to compare

@lahmatiy lahmatiy released this 14 Sep 14:40