
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@jordanwalsh23/postman-mock-builder
Advanced tools
Allows you to programmatically build a mock server and run it locally using Postman collections.
This package allows you to programmatically build Postman collections, and run these within your node.js applications.
The main use case for this service is to make Consumer Driven Contract Testing more accessible with Postman Collections.
Consumers can use this library to codify the way they are using a particular API and generate a collection that matches this behaviour.
The generated collection can then be provided to an API producer where they can import this and run it using Postman/Newman.
The generated collection will have the following features;
npm install @jordanwalsh23/postman-mock-builder
const PostmanMockBuilder = require("@jordanwalsh23/postman-mock-builder");
//Port that we would like to run the local server on
const PORT = 3000;
//Placeholder for the server we are going to create.
let mockServer;
describe('Test Suite', () => {
before(() => {
mockServer = PostmanMockBuilder.create({
apiVersion: "v1"
})
})
describe('Retrieve Products from DB', () => {
let state, request;
let expectedResponse = [
{
id: '1234',
name: 'Product 1',
description: 'This is product 1',
model: 'P1',
cost: 100
}
];
before(() => {
//Add a state that the system should be in for this test case to run.
state = mockServer.addState("A product exists in the database");
//Add a request to the state
request = state.addRequest({
method: "GET",
path: "/api/products"
});
//Add an expected response for the request.
request.addResponse({
status: 200,
body: expectedResponse
})
//Start the server.
mockServer.start(PORT);
//Server will be started on http://localhost:$PORT
})
it('Retrieve the products from the server', (done) => {
//Now that the server has been started we can run our test.
axios.get(`http://localhost:${PORT}/api/products`)
.then(response => response.data)
.then(products => {
//Assert there's only 1 product in the response.
assert(products.length == 1)
let product = products[0];
assert(product.id == expectedResponse.id);
assert(product.name == expectedResponse.name);
assert(product.description == expectedResponse.description);
assert(product.model == expectedResponse.model);
assert(product.cost == expectedResponse.cost);
done()
})
.catch(error => done(error));
})
})
after(() => {
//Export the collection you've created to a file.
mockServer.exportCollection('postman/collection.json')
//Stop the local mock server.
mockServer.stop()
})
})
Postman's API platform is an amazing tool that is used by millions of API developers around the world. Postman makes it simple to create Collections using the tooling and these can then be used to manage the lifecycle around your API.
Building collections today can be done in one of a few ways:
One of the challenges presented here is how do you keep your API implementation code in sync with your Postman collection? How do you make sure that if you change a field, update some logic or make an architectural change that you haven't broken the collection?
This project aims to bring the development of the Collection to within the API codebase. This can then be used as a local server to run tests against, and finally generate the Collection to be run and shared on Postman.
Currently States (folders) cannot be created inside other States. The service only supports 1 level of depth.
Contributions are welcomed on this repo. Please raise an issue with your request and if you like raise a PR for approval.
See the LICENSE file.
FAQs
Allows you to programmatically build a mock server and run it locally using Postman collections.
The npm package @jordanwalsh23/postman-mock-builder receives a total of 0 weekly downloads. As such, @jordanwalsh23/postman-mock-builder popularity was classified as not popular.
We found that @jordanwalsh23/postman-mock-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.