Configure newman json reporter to not write results to disk

I was unable to find a param that can stop the newman json reporter from writing results using the run function to disk. Any tips?

Hey @docyes :wave:

Welcome to the Postman Community! :postman:

Could you provide some more context and an example of this please?

Doesn’t that reporter create a json file, wouldn’t it need to write to disk to store the file? Perhaps I’m not understanding what you’re doing here. :thinking:

Hi Danny,

I am interested in using newman as a library
GitHub - postmanlabs/newman: Newman is a command-line collection runner for Postman and specifically the json reporter and the run callback paramater in the summary argument:
GitHub - postmanlabs/newman: Newman is a command-line collection runner for Postman

Goal is to use the newman.run function and get the results from the reporter and the summary callback instead of having it write the results to the file system.

If you’re using it as a library within a script, you don’t need to attach a reporter.

All of the data that gets fed into all the reporters comes from the Summary Object.

You need to use the various .on() events to capture this during the run and that can be logged to the console.

That makes sense. So my specific question is what is the option to pass telling Newman to not write results to disk if I am manually capturing them.

It’s not the end of the world but having a process that writes to disk (Newman) requires a cleanup activity from a developer standpoint. So passing a null reporter will solve this?

The default reporter is the CLI reporter, that will log the requests details and a summary of the run in the form of a table, to the terminal.

You would just need to remove the -r <your_reporter> from your command.

Ok, so use the default reporter and write my own json reporter from the event listener?

If that’s something that you’d like to do - there have been many great community reporters created.

It would be great to see what you come up with. :heart:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.