explaingit

postmanlabs/newman

7,216JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

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.

Mindmap

mindmap
  root((newman))
    What it does
      Run Postman collections
      CLI execution
    Input
      Local JSON files
      URL or Postman cloud
      Environment files
    Output
      Terminal report
      JUnit XML
      HTML report
    Integration
      CI CD pipelines
      Node.js library
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a Postman collection in a CI/CD pipeline to verify all API endpoints pass after every code deploy.

USE CASE 2

Generate a JUnit XML or HTML report from an API test run to display results in Jenkins or share with a team.

USE CASE 3

Trigger Newman programmatically from a Node.js script to run API tests as part of a custom test harness.

Tech stack

JavaScriptNode.js

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

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.

Copy-paste prompts

Prompt 1
How do I run a Postman collection with Newman in a GitHub Actions workflow, using a separate environment file to switch between staging and production URLs?
Prompt 2
Show me the Newman CLI command to run a Postman collection and generate an HTML report I can share with stakeholders.
Prompt 3
I want to import Newman as a Node.js library and run a collection programmatically inside a test script. What does the code look like?
Open on GitHub → Explain another repo

← postmanlabs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.