fake-json-stream

1.0.0 • Public • Published

fake-json-stream

Streaming fake json data

Install

npm i fake-json-stream

Use

const Fake = require('fake-json-stream')
const rs = Fake(1000)
rs.pipe(process.stdout)

Since fake-json-stream returns a readable stream you can also pipe to a write stream.

const fs = require('fs')
const Fake = require('fake-json-stream')
const rs = Fake(1000000) // creates a million products!
const ws = fs.createWriteStream('./data.json')
rs.pipe(ws)

This is great for creating a ton of sample json without the process crashing because you aren't keeping the entire thing in memory, but just each readable chunk.

Dependencies (2)

Dev Dependencies (4)

Package Sidebar

Install

npm i fake-json-stream

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mk