npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

random-json-stream

v1.0.2

Published

random json stream (+ cli)

Readme

random-json-stream

This is a nodejs stream that outputs random json. Thanks to @ralphtheninja's slump

Usage

var rjs = require('random-json-stream')
var ndjson = require('ndjson')

rjs()
  .pipe(ndjson.stringify())
  .pipe(process.stdout)

Options:

  • count - number of objects, 0 means infinity (default: 0)
  • objects - whether to output objects or other things (default: false)
var rjs = require('random-json-stream')
var ndjson = require('ndjson')

rjs({ count: 10, objects: true })
  .pipe(ndjson.stringify())
  .pipe(process.stdout)

Commandline

Works on the commandline, too! Thanks to @maxogden's ndjson.

> npm install -g random-json-stream
> random-json -h
random-json <options> - generate random json

Options:
  -h, --help     this help text
  -c, --count    count of json objects (0 = infinity)  [default: 0]
  -o, --objects  json objects only                     [default: false]

Output 3 json objects:

> random-json -o -c 3
{"\u000bzۃ���A":-0.5168690651358595,"\u0000��[\u0017�ϳ�\u0011":795542121}
{"���":-1.2109458962934139,"�N[�\u00013̍\u0018":false,"Dʥ\ts(8�\u0005":{"~":{"�t�y�4�O\u0011\u001f":null,"��\b��c\u0013":0.2814008676018912},"G>J'C����l":false},"\u0010��9來":null,"�":1.2500814018104633,"+L�ш�����":-0.31865016626084536,"3�l��\u0016*":[true,true,false,null,false,true],"���\u001c�,�˦ԭ":null,"JҊ�;p":null}
{"�G�親�":-1267257782,"�":false,"H.f�[�":true,"`���R&":3680551801,"j�\t����":-1.6277292216680663,"\u0005� �>��\u000e\u001a7":1.1395421200213478}

Output infinite valid json elements:

random-json

Useful for debugging parsers and codecs:

random-json | my-parser
random-json | json2cbor
random-json | json2cbor | cbor2json
random-json | json2xml
random-json | json2ubjson