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

mc-postman-viewer

v1.1.0

Published

World-class CLI to visualize Postman collections in a browser — Monaco editor, interactive canvas, full API docs, dark/light themes, and one-click PDF export.

Readme

mc-postman-viewer

A world-class CLI that turns any Postman collection into a beautiful, interactive browser UI — Monaco editor, visual API canvas, full documentation, built-in mock server, integrated REST client, dark/light themes, and one-click PDF export.

npm version License: MIT Node.js


Screenshots

Postman-viewer-1

Postman-viewer-2

Postman-viewer-3

Postman-viewer-mock


Features

| Feature | Details | |---|---| | Monaco Editor | Full JSON editor with syntax highlighting, minimap, and auto-format | | Visual Canvas | Collapsible folder tree with method badges, auth indicators, and hover effects | | API Documentation | Table of contents + full endpoint reference with params, headers, and request body tables | | Mock Server | Instantly serve canned responses from collection example responses on a separate port | | Mock Client | Built-in REST client with route/example dropdowns, Monaco response viewer, and header management | | PDF Export | Clean print window with white-background, print-safe layout | | Dark / Light Theme | Seamless toggle — CSS custom properties ensure every element switches correctly | | Animated Splitter | Drag to resize editor and canvas panes; gradient handle with pulse animation | | WebSocket Live Reload | Hit ↺ Reload to re-read the file or re-fetch the URL without restarting | | 4 View Modes | Both · Editor only · Canvas only · Docs only | | Splash Screen | Animated welcome screen with feature highlights on first load | | Guided Tour | Step-by-step walkthrough of every UI element | | Context Help | Hover ? badges on any control for instant inline explanations | | Local file or URL | Load from disk with -f or fetch from any HTTP URL with -r |


Quick Start

Run without installing

npx mc-postman-viewer -f ./my-collection.json

Install globally

npm install -g mc-postman-viewer
postman-viewer -f ./my-collection.json

The browser opens automatically at http://localhost:3000.


Usage

postman-viewer [options]

Options:
  -f, --file <path>        Path to a local Postman collection JSON file
  -r, --url <url>          URL to fetch a Postman collection JSON from
  -p, --port <number>      Port to run the viewer on (default: 3000)
  --mock                   Start a mock server from collection example responses
  --mock-port <number>     Port for the mock server (default: 4001)
  --no-open                Do not auto-open the browser
  -V, --version            Output the version number
  -h, --help               Display help

Examples

# Load a local file
postman-viewer -f ./samples/petstore.json

# Fetch from a URL
postman-viewer -r https://raw.githubusercontent.com/your-org/repo/main/collection.json

# Start viewer + mock server together
postman-viewer -f ./samples/mock-demo.json --mock

# Mock server on a custom port
postman-viewer -f ./samples/mock-demo.json --mock --mock-port 5000

# Custom viewer port, no auto-open
postman-viewer -f ./collection.json -p 4000 --no-open

# Use npx directly without installing
npx mc-postman-viewer -f ./my-collection.json

Panes

Left — Monaco Editor The raw collection JSON is loaded into the Monaco editor (same engine as VS Code). Inspect, search, and read the full source with syntax highlighting and minimap.

Right — Canvas A visual, folder-grouped tree of every endpoint. Each folder is collapsible. Rows show:

  • HTTP method badge with colour coding
  • Endpoint name and URL
  • Auth type badge (Bearer, OAuth2, API Key, Basic)

Right — Documentation A rendered API reference suitable for sharing or printing:

  • Cover page with collection name and description
  • Table of contents with method badges
  • Per-endpoint sections: URL, description, parameters, headers, and request body

Right — Mock Client A full REST client for testing your mock server:

  • Route dropdown auto-populated from the running mock server
  • Example dropdown selects a specific saved response via X-Mock-Response-Name
  • Monaco editor for the response body (syntax highlighted, pretty-printed, read-only)
  • Response headers table
  • Status badge (colour-coded) and response time

Mock Server

The --mock flag starts a second Express server on --mock-port (default 4001). It reads every response[] example in the collection and registers them as live HTTP routes.

postman-viewer -f ./samples/mock-demo.json --mock

Console output shows every registered route:

  Mock Server  running at http://localhost:4001
  Routes index: http://localhost:4001/mock-routes
  Registered 9 mock route(s):
    GET     /v2/pets          [200 OK – pet list, 500 Internal Server Error]
    GET     /v2/pets/:petId   [200 OK – single pet, 404 Not Found]
    POST    /v2/pets          [201 Created, 400 Bad Request]
    ...

Selecting a specific example response

Pass the X-Mock-Response-Name header with the exact example name:

# Returns the 404 example instead of the default 200
curl http://localhost:4001/v2/pets/1 -H "X-Mock-Response-Name: 404 Not Found"

Route index

curl http://localhost:4001/mock-routes

Returns a JSON array of all registered routes with their example names.


Keyboard & Controls

| Control | Action | |---|---| | Drag splitter | Resize editor / canvas panes | | Click folder header | Collapse / expand folder | | Both / Editor / Canvas / Docs | Switch view layout | | Canvas / Documentation / Mock Client | Switch right pane content | | 🌙 Dark / ☀ Light | Toggle theme | | ↺ Reload | Re-read file or re-fetch URL live | | ⬇ Export PDF | Open print-ready docs in a new window | | ? (help badges) | Hover any ? badge for context-sensitive help | | Tour button | Click to start the guided walkthrough |


HTTP Method Colours

| Method | Colour | |---|---| | GET | Green | | POST | Blue | | PUT | Amber | | PATCH | Purple | | DELETE | Red | | HEAD | Gray | | OPTIONS | Teal |


Sample Collections

Three ready-to-use collections are included in samples/.

mock-demo.json — Mock Server Demo

A Petstore-style collection with full example responses on every endpoint — designed specifically to test the mock server and built-in client.

postman-viewer -f ./samples/mock-demo.json --mock

Folders: Pets · Store · Users
Routes: 9 · Examples: 16 (200, 201, 204, 400, 404, 500)

petstore.json — Petstore API

A classic REST API for a pet store (no saved examples — viewer/docs use).

postman-viewer -f ./samples/petstore.json

Folders: Pets · Store · User
Endpoints: 16 · Auth: Bearer, API Key

github-api.json — GitHub REST API

A curated subset of the GitHub v3 API.

postman-viewer -f ./samples/github-api.json

Folders: Authentication · Repositories · Branches & Commits · Pull Requests · Issues
Endpoints: 18 · Auth: Bearer (PAT)


Postman Collection Format

mc-postman-viewer supports Postman Collection v2.1. To export from Postman:

  1. Open your collection in Postman
  2. Click the ⋯ menu next to the collection name
  3. Select Export
  4. Choose Collection v2.1
  5. Save the .json file and pass it to postman-viewer -f

For mock server support, make sure your requests have saved example responses (response[] in the collection JSON).


License

MIT © Mohan Chinnappan