Socket
Book a DemoInstallSign in
Socket

@paultaku/node-mock-server

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paultaku/node-mock-server

A TypeScript-based mock server with automatic Swagger-based mock file generation

1.1.0
latest
Source
npmnpm
Version published
Weekly downloads
24
118.18%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js Mock Server

A TypeScript-based mock server with automatic Swagger-based mock file generation.

Features

  • Automatic Mock Generation: Generate mock data from Swagger/OpenAPI specifications
  • File-based Routing: Serve mock responses based on file system structure
  • Path Parameter Support: Handle dynamic route parameters
  • Multiple Response Types: Support different HTTP status codes and response formats
  • CLI Tool: Command-line interface for generating mock files
  • TypeScript Support: Full TypeScript implementation with type safety

Quick Start

Generate Statice File Data from swagger.yml

# Generate mock files from Swagger YAML
npx @paultaku/node-mock-server -s demo/swagger.yaml -o mock/

List support flag for further configuration

# Generate mock files from Swagger YAML
npx @paultaku/node-mock-server -h
# Options
-s, --swagger <path>  Path to swagger yaml file
-o, --output <path>   Output mock root directory
-h, --help           Display help for command

How to run a local mock server

import pkg from "@paultaku/node-mock-server";
import path from "path";
const { startMockServer } = pkg;

const mockRoot = path.resolve("./mock");
console.log(mockRoot);

startMockServer(8888, mockRoot);

License

MIT License - see LICENSE file for details.

Keywords

mock-server

FAQs

Package last updated on 08 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.