# thongs

> Thongs is a mock server with a fancy dashboard for local development. It is built in Express.js.

Latest version **1.0.4** (published 2026-08-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install thongs
pnpm add thongs
yarn add thongs
bun add thongs
```

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2026-08-02 |
| First published | 2021-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 666.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | gitbong |
| Keywords | JSON, server, fake, API, prototyping, mock, mocking, test, testing, rest, data, dummy |

## Links

- npm: https://www.npmjs.com/package/thongs
- Repository: https://github.com/gitbong/thongs
- Homepage: https://github.com/gitbong/thongs#readme
- Issues: https://github.com/gitbong/thongs/issues
- npm.io page: https://npm.io/package/thongs

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.18.1
- [express](https://npm.io/package/express.md) ^5.2.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.4 (latest) — 2026-08-02
- 1.0.3 — 2024-05-26
- 1.0.2 — 2021-12-22
- 1.0.1 — 2021-12-21
- 1.0.0 — 2021-12-21

## README

# 🩴 Thongs
Thongs is a mock server with a fancy dashboard for local development. It is built in Express.js.

## Key Features
- setup several responses for one API
- easy to switch responses for an API call on dashboard
- mock a delay for API call

## Quick start

Step 1: Make a new directory and install the package:
```sh
$ mkdir mock && cd mock
$ npm init
$ npm install thongs
```

Step 2: Create a index.js file and paste the example below:
```javascript
var { default: Thongs } = require("thongs");

const routes = [
  {
    name: "Get all books",
    path: "/v1/books",
    method: "GET",
    handlers: [
      {
        name: "success",
        status: 200,
        handler: (request, response) => {
          return [
              {
                  name: 'Harry Potter 1',
                  author: 'J.K. Rowling',
              },
              {
                  name: 'Harry Potter 2',
                  author: 'J.K. Rowling',
              }
          ];
        },
      },
      {
        name: "fail",
        status: 500,
        handler: (request, response) => {
          return 'Server error';
        },
      },
    ],
  },
];
const port = 3000;
const mockServer = Thongs(routes);
mockServer.start(port);
``` 

Step 3: In the terminal run the command below:
```sh
$ node index.js
> Thongs mock server is running on http://localhost:3000
```
Step 4: Enjoy it. 


---
### ☕
If you feel Thongs is making your life easier, please consider buy me a coffee.

PayPal: [click me](https://www.paypal.com/paypalme/gitbong)


支付宝: gitbong@qq.com

---
_Source: https://npm.io/package/thongs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
