Registry / testing / bloomrpc-mock

bloomrpc-mock

JSON →
library0.3.4jsnpmunverified

BloomRPC-Mock is a command-line utility and toolset library for automatically mocking gRPC services based on .proto files. The current stable version is 0.3.4, released as an early-stage project. It reads a protobuf definition and starts a gRPC server that responds with default mock data for all defined RPC methods. Key differentiators include being a simple CLI tool (built with oclif) that requires zero configuration, support for client-side and bi-directional streaming, and automatic generation of mock responses. However, it is still experimental with missing features like custom mock responses.

npm install bloomrpc-mock
INSTALL
IMPORT
SIG · BLOOMRPC-MOCK
B
bloomrpc-mock
testingjavascriptv0.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bloomrpc-mock (CLI)
npx bloomrpc-mock service.proto
npm run bloomrpc-mock
The package is a CLI tool; the primary usage is via npx or global install. There is no JavaScript import for the main functionality.
MockServer
import { MockServer } from 'bloomrpc-mock'
const MockServer = require('bloomrpc-mock')
TypeScript types are included. CommonJS require should work but the package is ESM-friendly.
getDefaultMock
import { getDefaultMock } from 'bloomrpc-mock'
Utility function to generate default mock responses for a given protobuf message.

Creates a sample protobuf service, starts the mock gRPC server, and demonstrates basic interaction.

// 1. Create a .proto file (e.g., service.proto) syntax = "proto3"; service ItemRepository { rpc GetByID (GetByIDRequest) returns (Item); } message GetByIDRequest { string id = 1; } message Item { string id = 1; string name = 2; } // 2. Run the mock server // npx bloomrpc-mock service.proto // 3. Use a gRPC client to call the service // The server will respond with default mock data. // For streaming methods, it will stream mock responses.
Debug
Known issues
gotchaPackage is experimental: many features are missing (custom mock responses, reflection, etc.).
fix
Check the GitHub issues or roadmap before relying on advanced features.
affects: <1.0.0
deprecatedThe package requires Node.js >=8.0.0, which is EOL.
fix
Upgrade Node.js to LTS version (>=18).
affects: >=0.0.0
gotchaCLI command must be run from directory containing the .proto file or provide full path.
fix
Use absolute or relative path to the .proto file: npx bloomrpc-mock ./path/to/service.proto
affects: >=0.0.0
gotchaNo built-in support for custom mock responses; all methods return auto-generated default data.
fix
Currently only default mocks are supported. Consider contributing or waiting for a future release.
affects: <0.4.0
Errors
Common errors & fixes
Error: Cannot find module 'bloomrpc-mock'
Package not installed or not globally installed.
fix
Install globally: npm i -g bloomrpc-mock, or use npx: npx bloomrpc-mock
Error: ENOENT: no such file or directory, open 'service.proto'
The .proto file path is incorrect or missing.
fix
Provide the correct path to the .proto file, e.g., npx bloomrpc-mock ./proto/service.proto
Error: listen EADDRINUSE :::3009
Default port 3009 is already in use.
fix
Specify a different port using the --port flag: npx bloomrpc-mock --port 4000
Upgrade
Version history
0.3.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
bloomrpc-mock — npm install bloomrpc-mock · libregistry