nv-random-json-stream

1.0.6 • Public • Published

nv-random-json-stream

  • slowly generate a random very big nested json file (which can NOT be load by js, but can handle by c++) for test using
  • slow, about 3M / second for sync
  • very slow, about 100K /second for async

install

  • npm install nv-random-json-stream

usage

  const {
      sync_to_stream,    sync_to_file,
      async_to_stream,   async_to_file,
  }   = require("nv-random-json-stream");

example

sync

  //although named sync, also need await (await the 'end' event) 
  const to_stream = (wstream,estimated_maxsz=1024*1024) => {
  const to_file = (fn="./rnd.json",estimated_maxsz=1024*1024,flags="w",start=0)=> {

async

 const to_stream = async (wstream,estimated_maxsz=1024*1024*8) => {
 const to_file = (fn="./rnd.json",estimated_maxsz=1024*1024*8,flags="w",start=0)=> {

METHODS

APIS

LICENSE

  • ISC

Readme

Keywords

none

Package Sidebar

Install

npm i nv-random-json-stream

Weekly Downloads

1

Version

1.0.6

License

ISC

Unpacked Size

21.3 kB

Total Files

11

Last publish

Collaborators

  • ihgazni2