newman
Newman is a command-line collection runner for Postman
A command-line tool that runs Postman API test collections from a terminal so you can automate API testing in CI/CD pipelines, produce JUnit or HTML reports, and trigger collection runs from Node.js code.
Newman is a command-line tool that runs Postman collections outside of the Postman application. Postman is a popular tool developers use to test and document APIs, and it provides a graphical interface for building and running requests. Newman takes those same collections and runs them from a terminal, which makes it possible to include API tests in automated build and deployment pipelines.
A Postman collection is a saved group of API requests with test scripts attached. When a team builds software that communicates with external services or its own backend, Newman lets them verify that all those connections work correctly as part of every code change, rather than relying on manual testing. The tool reads the collection file (a JSON file exported from Postman), sends each request, runs the attached test assertions, and reports which ones passed or failed.
Newman can read collections from local files or directly from a URL, including from the Postman cloud. It supports environments and global variables, which are files that store values like base URLs or authentication tokens so the same collection can run against different servers by swapping out the variable file.
Reports can be produced in several formats: the default colored output in the terminal, a JSON file for machine processing, a JUnit XML file for CI tools like Jenkins, or an HTML file for sharing results. External reporters published by the community can also be plugged in, and teams can write their own if the built-in formats do not fit their workflow.
Newman is also available as a Node.js library, meaning developers can import it into their own JavaScript projects and trigger collection runs programmatically rather than through the command line.
The full README is longer than what was shown.
Where it fits
- Run a Postman collection in a CI/CD pipeline to verify all API endpoints pass after every code deploy.
- Generate a JUnit XML or HTML report from an API test run to display results in Jenkins or share with a team.
- Trigger Newman programmatically from a Node.js script to run API tests as part of a custom test harness.