Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for streaming large documents #111

Merged
merged 61 commits into from
Dec 7, 2023
Merged

Support for streaming large documents #111

merged 61 commits into from
Dec 7, 2023

Conversation

josdejong
Copy link
Owner

@josdejong josdejong commented Dec 7, 2023

Implement streaming support in Node.js and the CLI

See #106

Important to note is that for now I've implemented the streaming version alongside the regular function. The streaming version can be wrapped such that it acts like the regular version, but it works with a limited buffer which can possibly throw an "Index out of range" error when repairing a document with a string that is larger than the configured buffer. It is possible to configure bufferSize: Infinity, but that has a negative impact on the performance, making it slower than the regular version. Also, the regular version is much less code, so better suitable for use in the browser. Both implementations are tested against the same extensive set of unit tests to make sure they behave the same.

# Conflicts:
#	src/jsonRepairProxy.ts
#	src/jsonrepair.test.ts
# Conflicts:
#	src/jsonrepair.ts
@josdejong josdejong merged commit 79f7a66 into main Dec 7, 2023
3 checks passed
@josdejong josdejong deleted the feat/streaming branch December 7, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant