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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fakeson

v0.0.3

Published

Library for creating fake json documents

Downloads

3

Readme

#fakeson (pronounced FAKE-SON)

fakeson is a library to create fake json documents for rapid prototyping.

##Example

###Input user.fakeson

{
	"name": name(),
	"bio": sentences(5, 10, 3, 8), //(min/max number of sentences, min/max length of words)
	"username": chars(5, 9),
	"joined": date({ yearRange: -1 }),
	"title": title(3, 4),
	"paid": bool(),
	"status": range(0, 5)
}

###Output user.json

{
	"name": "Patrick",
	"bio": "The heard time if right usually. Until above work. See study off me out. Sure if different. Many world big. ",
	"username": "wswcyv",
	"joined": "2012-08-30T12:21:34.427Z",
	"title": "Go When Put",
	"paid": false,
	"status": 0
}

You can see an example with arrays here.

##Installation

npm install -g fakeson

##Usage ###CLI

$ fakeson --help

fakeson 0.0.1
Usage: fakeson [options] [file]

Options:
  -p, --pretty  Pretty print json output  [boolean]  [default: false]

$ fakeson user.fakeson --pretty > user.json

###AJAX If you don't want to mess with running the cli commands over and over again, there is also a webserver available that will serve up your fakeson files over ajax (with CORS).

fakejax --port 8000 [folder to fakeson files]

Then you can hit http://localhost:8000/user and you will see the generated file for user.fakeson. The results are cached, so they are only generated once. If you want to change that, just pass in the --update parameter to the fakejax command

##Array Example

###Input user.fakeson (same as above)

list.fakeson

{
  "users": array(5, 20, 'user.fakeson')
}

###Command

fakeson user.fakeson --pretty > user.json

###Output

{
	"users": [
		{
			"name": "Garth",
			"bio": "Them day does such one own. Around might you whole no give her. Four would to looked following. Important most what place. So are good are now. That sound best don't room. Himself ever near. There important paper under tell animals far. Under more soon if she as. ",
			"username": "ianowcjdb",
			"joined": "2012-07-14T16:29:36.295Z",
			"title": "Following Go We",
			"paid": false,
			"status": 5
		},
		{
			"name": "Conrad",
			"bio": "Under keep would know ways. Turned some have even need be make. Going called they as great was. Took another found ways. Will see today. Part called small. ",
			"username": "ikwqem",
			"joined": "2012-02-01T10:11:17.603Z",
			"title": "Other Water About Night",
			"paid": true,
			"status": 5
		},
		{
			"name": "Louise",
			"bio": "In then not should used he without next. Parts some but may. I have used without make white. Good out left light read us ever. Eyes see I work room. Same so earth out their got. While end parts sound see. Which may example need try children. ",
			"username": "lfhobou",
			"joined": "2011-12-17T23:12:27.959Z",
			"title": "My Four For",
			"paid": false,
			"status": 5
		},
		...
	]
}

##Available Fake Data Functions

Anything that is in mockdata is available in fakeson.

{
  "chars": chars(5, 9),
  "name": name(),
  "num": n(10),
  "bigNumber": bignumber(5),
  "site": site(),
  "url": url(),
  "date": date({ delimiter: '/' }),
  "title": title(3, 4),
  "sentences": sentences(5, 10, 3, 8),
  "bool": bool(),
  "color": color(),
  "word": word(),
  "range": range(5, 7)
}

##API

var fakeson = require('fakeson');

//return string
var jsonString = fakeson('user.fakeson');

//return json object
var json = fakeson('user.fakeson', false);

//return pretty string
var json = fakeson('user.fakeson', true, true);