Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
I have a collection with a single request: https://api.onlinedatabasetool.com/api/catalogline/{{id}}
When I run newman using the command line with a data file I successfully make 30 requests:
newman run Product-enviroment.postman_collection.json -d response.json
When I try to run the same collection programmatically it runs 30 iterations (which corresponds to the amount of rows in the data file) but it is not actually doing the requests, just iterations.
This is the file I’m executing:
const newman = require('newman'),
fs = require('fs');
newman.run({
collection: require('./Product-enviroment.postman_collection.json'),
iterationData: './response.csv',
reporters: 'cli'
}).on('beforeRequest', function (error, args) {
console.log(args.request.body.raw);
}).on('request', function (error, args) {
console.log(args.response.stream);
});
Here is an article which is where I got the file from:
https://medium.com/apis-with-valentine/postman-how-to-write-files-to-disk-5ee398624a42
Not sure what I’m doing wrong.




