deno_std | Deno standard library
kandi X-RAY | deno_std Summary
kandi X-RAY | deno_std Summary
Deno standard library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of deno_std
deno_std Key Features
deno_std Examples and Code Snippets
Community Discussions
Trending Discussions on deno_std
QUESTION
I often find myself reading a large JSON file (usually an array of objects) then manipulating each object and writing back to a new file.
To achieve this in Node (at least the reading the data portion) I usually do something like this using the stream-json module.
...ANSWER
Answered 2019-Nov-24 at 23:59I think that a package like stream-json
would be as useful on Deno as it is on NodeJs, so one way to go might surely be to grab the source code of that package and make it work on Deno. (And this answer will be outdated soon, because there are lots of people out there who do such things and it won't take long until someone – maybe you – makes their result public and importable into any Deno script.)
Alternatively, although this doesn't directly answer your question, a common pattern to treat large data sets of Json data is to have files which contain Json objects separated by newlines. (One Json object per line.) For example, Hadoop and Spark, AWS S3 select, and probably many others use this format. If you can get your input data in that format, that might help you to use a lot more tools. Also you could then stream the data with the readString('\n')
method in Deno's standard library: https://github.com/denoland/deno_std/blob/master/io/bufio.ts
Has the additional advantage of less dependency on third-party packages. Example code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install deno_std
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page