quadstorejs / quadstore

A LevelDB-backed graph database for JS runtimes (Node.js, Deno, browsers, ...) supporting SPARQL queries and the RDF/JS interface.
https://github.com/quadstorejs/quadstore
MIT License
203 stars 14 forks source link

use readable-stream module #68

Closed elf-pavlik closed 5 years ago

elf-pavlik commented 5 years ago

https://www.npmjs.com/package/readable-stream

If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use readable-stream only and avoid the "stream" module in Node-core, for background see this blogpost. [...] readable-stream is maintained by the Streams Working Group, which oversees the development and maintenance of the Streams API within Node.js.

I used quadstore in simple prototype app running in a web browser and streams from RdfStore#match didn't have AsyncIterator. Using this module fixes it and it looks like recommended way of using Node.js streams.


This change is Reviewable

jacoscaz commented 5 years ago

Hello @elf-pavlik ! Thank you for this PR. I am generally hesitant about depending on readable-streams instead of the natively-shipped stream library for backend-only projects. However, while it was born on the backend, quadstore now targets both the backend and frontend side of JS development and it makes sense to switch to readable-stream.

jacoscaz commented 5 years ago

Merged in version 5.1.0, which I have just published to NPM.