npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

newman-server

v0.9.2

Published

A REST server for Newman

Downloads

21

Readme

Node.js CI

newman-server

newman-server is a simple NodeJS server that can run your Postman's collections, using the newman engine.

🚩 Requires nodeJS >= 20 🚩

Example:

$ npm install -g newman-server
$ newman-server
Server started on port 8080
Access http://localhost:8080 to test the server

If you don't want to do a global installation, you can use npx to run a locally installed dependency

$ npx newman-server

The server expose a simple POST /run/{outputType} endpoint that expect the Postman collection as a form data input. For example POST /run/json for will use the json newman reporter. An basic index.html is provided to try running your collection.

Features

Supported outputs

| Output type | Path param | Reporter used | | ----------- | ---------- | ------------------------------------------------------- | | JSON | json | https://github.com/postmanlabs/newman#json-reporter | | JUnit | junit | https://github.com/postmanlabs/newman#junitxml-reporter | | HTML | html | https://www.npmjs.com/package/newman-reporter-htmlextra |

Form Inputs

| Form input | Type | Description | | ----------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- | | collectionFile | .json file | The Postman JSON collection file | | iterationDataFile | .json file | (Optional) The Postman iteration data JSON file |

CLI options

| Option | Type | Default | Description | | ----------------- | ------ | -------------- | ------------------------------------------------------------------------ | | port | number | 8080 | The server's port | | tempReportsFolder | path | ./temp_reports | The folder where the temporary XML and HTML report file will be created. |

OpenApi doc

To have more details about the endpoints shape, you can look at the server OpenApi documentation

Health check endpoint

The server is exposing the endpoint GET /api/health that verifies that the server is in an healthy state. When the endpoint is called, the program will check that:

  • It has read/write access to the temparory result folder
  • The newman NPM package has been successfully installed and is able to run a Postman collection If the tests succeed, the response status code will be 200, otherwise it will respond with a 500.

Convert to HTML endpoint

The server is exposing the endpoint POST /convert/html that expects JSON summary file as form data input that can be received through POST /run/json. If the provided summary file is valid, the response will be 200 with HTML report, otherwise it will respond with a 400 and error.

Developer's guide

Local test and run

$ npm ci
$ npm test
$ npm run dev

Install the CLI locally

$ npm pack
$ npm install -g newman-server-x.x.x.tgz
$ newman-server