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

@g-konst/fake_api

v1.0.1

Published

Simple app that return a fake data for your API request

Downloads

23

Readme

Donate node_version Heroku

fakeAPI

This is a simple nodejs application that return a fake data for your API request.

Table of Contents:

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

Prerequisites

First, you need to install nodejs. You can get it here (https://nodejs.org/en/)

If done, check the version (it should be >= 10.0.0)

$ node -v
v12.18.3

Installing

Clone repo and install packages

git clone https://github.com/g-konst/fakeApi && cd fakeApi
npm install

Running

To run fakeApi on your local machine, use this command:

$ node app.js

or with npm

$ npm start

Examples

curl 'http://localhost:3000/api/' \
    -H 'content-type: application/json' \
    -d '{
      "_repeats": 2,
      "user": "name.findName",
      "id": "random.number",
      "company": "company.companyName",
      "email": "internet.email",
      "avatar": "internet.avatar",
      "jobs": "name.jobTitle",
      "is_active": "random.boolean",
      "phone": "phone.phoneNumber",
      "posts": {
          "text": "lorem.sentences",
          "_repeats": 3
      }
}'
[
    {
        "user": "Muriel Lind",
        "id": 19287,
        "company": "Little LLC",
        "email": "[email protected]",
        "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/davidhemphill/128.jpg",
        "jobs": "National Group Executive",
        "is_active": false,
        "phone": "447-661-3540",
        "posts": [
            {
                "text": "Ut et voluptatem atque mollitia exercitationem nihil voluptatibus doloribus reprehenderit. Cumque voluptatem dignissimos nihil eos voluptates earum deleniti.",
                "id": 0
            },
            {
                "text": "Dolorem inventore corporis ea asperiores iste. Esse qui ducimus sequi adipisci animi ratione. Perspiciatis labore consequatur placeat doloribus similique ipsum.",
                "id": 1
            },
            {
                "text": "Incidunt aliquam ea qui officia earum animi neque. Voluptatem sed ad incidunt in provident voluptatem. Voluptas error cum. Debitis a doloremque officia laudantium.",
                "id": 2
            }
        ]
    },
    {
        "user": "Shemar Schmidt",
        "id": 58963,
        "company": "O'Reilly - Schuppe",
        "email": "[email protected]",
        "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/rude/128.jpg",
        "jobs": "Human Metrics Supervisor",
        "is_active": false,
        "phone": "390.219.0639",
        "posts": [
            {
                "text": "Exercitationem modi sit. Ducimus eum aliquam saepe natus enim quae architecto. Fugiat nisi voluptatem quisquam placeat.",
                "id": 0
            },
            {
                "text": "Architecto rerum aperiam recusandae est nam culpa. Dolorum sint in.",
                "id": 1
            },
            {
                "text": "Tempora aliquid repudiandae doloremque optio. Qui molestias possimus qui et distinctio. Odio praesentium occaecati. Impedit unde recusandae quidem. Ratione voluptatum quia debitis laborum. Quae aut officiis aliquid ab exercitationem aperiam aut architecto.",
                "id": 2
            }
        ]
    }
]
curl 'http://localhost:3000/api/' \
    -H 'content-type: application/json' \
    -d '{
      "_repeats": 0,
      "id": "",
      "pages": "random.number",
      "users": {
          "_repeats": 2,
          "user": "name.findName",
          "id": "random.number",
          "email": "internet.email",
          "avatar": "internet.avatar"
      },
      "posts": { "text": "lorem.sentences", "image": "random.image", "post_date": "date.past", "_repeats": 5 }
}'
{
    "id": 0,
    "pages": 66582,
    "users": [
        {
            "user": "Stefanie Gleason V",
            "id": 91768,
            "email": "[email protected]",
            "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/ainsleywagon/128.jpg"
        },
        {
            "user": "Justus Torp",
            "id": 98365,
            "email": "[email protected]",
            "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/eugeneeweb/128.jpg"
        }
    ],
    "posts": [
        {
            "text": "Et quia reprehenderit magni quia qui a. Nemo et atque consequuntur sunt deleniti vero blanditiis nostrum odit. Occaecati aliquam nihil sit. Et qui mollitia nihil et perspiciatis.",
            "image": "http://lorempixel.com/640/480/food",
            "post_date": "2020-07-15T07:56:47.498Z",
            "id": 0
        },
        {
            "text": "Ad eos alias non nemo velit culpa dolores id iure. Quibusdam reiciendis aliquam aut.",
            "image": "http://lorempixel.com/640/480/animals",
            "post_date": "2019-10-18T22:48:21.956Z",
            "id": 1
        },
        {
            "text": "Quos veritatis natus molestiae sed est repudiandae provident aperiam. Mollitia sunt quia ipsam aut et temporibus est necessitatibus. Odio minus debitis.",
            "image": "http://lorempixel.com/640/480/fashion",
            "post_date": "2020-02-08T23:05:27.043Z",
            "id": 2
        },
        {
            "text": "Accusamus aut qui quidem dicta fuga recusandae laboriosam totam. Dicta rerum sed ut voluptatibus repellat perspiciatis quo. Consequatur velit vero minima hic dolorem.",
            "image": "http://lorempixel.com/640/480/animals",
            "post_date": "2020-04-17T19:01:21.657Z",
            "id": 3
        },
        {
            "text": "Deleniti consequuntur et sed eaque rerum iure veritatis fuga. Quam molestias quod fuga accusantium. Ea iste qui qui molestiae autem provident et modi.",
            "image": "http://lorempixel.com/640/480/animals",
            "post_date": "2019-09-22T01:37:39.868Z",
            "id": 4
        }
    ]
}

You can also change locale by adding a locale parameter to request query:

curl 'http://localhost:3000/api/?locale=it' \
    -H 'content-type: application/json' \
    -d '{
      "id": "random.number",
      "avatar": "internet.avatar",
      "user_card": "helpers.createCard"
}'
[
    {
        "id": 2314,
        "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/dzantievm/128.jpg",
        "user_card": {
            "name": "Giancarlo Rizzi",
            "username": "Ingrid93",
            "email": "[email protected]",
            "address": {
                "streetA": "Martinelli Via",
                "streetB": "45009 D'amico Rotonda",
                "streetC": "3774 Ferrari Strada Suite 457",
                "streetD": "Suite 522",
                "city": "Sesto Deborah",
                "state": "Monza e della Brianza",
                "country": "Georgia",
                "zipcode": "28909",
                "geo": {
                    "lat": "-55.5395",
                    "lng": "90.5205"
                }
            },
            "phone": "017 667 6626",
            "website": "odino.org",
            "company": {
                "name": "Cattaneo e figli",
                "catchPhrase": "nazionale programmabile Paradigma",
                "bs": "mission-critical guida modelli"
            },
            "posts": [
                {
                    "words": "assumenda inventore ullam",
                    "sentence": "Enim aut id ut ipsa illo veritatis quo omnis.",
                    "sentences": "Illo facere fuga reprehenderit cupiditate ea sit. Fugit a et maiores est. Id omnis beatae similique natus placeat commodi. Corporis voluptatem dolorum expedita placeat omnis dolorem accusamus.",
                    "paragraph": "Ut sed voluptatem consequuntur ex debitis molestiae sed sint. Quia neque doloremque quia nihil et est enim. Suscipit magni natus nihil sit. Tempora tempora aut temporibus sit autem alias."
                },
                {
                    "words": "tenetur explicabo consequatur",
                    "sentence": "Repellat possimus praesentium quia eligendi.",
                    "sentences": "Omnis non sint cum dolore minus et. Recusandae ex sed quo qui fuga. Non voluptatem placeat vero et rerum reiciendis. Earum possimus id aut doloremque recusandae molestiae. Et facilis nostrum voluptatem aut voluptate maiores assumenda et.",
                    "paragraph": "Officiis qui quia. Quae omnis molestias deleniti dolorum ut aut id. Dolores libero corporis nobis et ut fuga. Neque rerum laboriosam est ipsum nihil id et et est."
                },
                {
                    "words": "enim ea distinctio",
                    "sentence": "Est earum aliquid dolorem magnam perferendis.",
                    "sentences": "Aut ut eum est sunt voluptatem laboriosam praesentium doloremque ducimus. Libero cupiditate saepe illo dolorem excepturi earum molestias illo. Et provident nam et. Ut porro quasi aut.",
                    "paragraph": "Culpa praesentium asperiores id et a est dolorem quia neque. Eveniet voluptate et. Sint tempore excepturi odit debitis error iure ex rerum in. Pariatur voluptates qui qui possimus sed est aut voluptas."
                }
            ],
            "accountHistory": [
                {
                    "amount": "825.17",
                    "date": "2012-02-02T00:00:00.000Z",
                    "business": "Negri, Romano and Fontana",
                    "name": "Credit Card Account 1820",
                    "type": "deposit",
                    "account": "85827485"
                },
                {
                    "amount": "470.66",
                    "date": "2012-02-02T00:00:00.000Z",
                    "business": "Carbon, Bernardi and Rizzi",
                    "name": "Investment Account 5741",
                    "type": "invoice",
                    "account": "18964923"
                },
                {
                    "amount": "265.48",
                    "date": "2012-02-02T00:00:00.000Z",
                    "business": "Lombardi SPA",
                    "name": "Checking Account 8190",
                    "type": "invoice",
                    "account": "00521733"
                }
            ]
        }
    }
]

Built With

  • Faker.js - generate massive amounts of fake data in the browser and node.js.
  • Express - Fast, unopinionated, minimalist web framework for node.

If you want to support this project, you can just: