1.0.6 • Published 10 months ago

nv-random-json-stream v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

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