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 🙏

© 2026 – Pkg Stats / Ryan Hefner

prettify-bru

v1.5.4

Published

Prettifies JSON and JavaScript blocks in Bruno .bru files

Readme

Prettify Bruno Bru Files

A CLI tool to prettify and format Bruno .bru files.

Uses Prettier to impose a standard format on all blocks of JSON and JavaScript code across multiple Bruno .bru files in your project.

Handles the following block types:

  • body:json
  • script:pre-request
  • script:post-response
  • tests

All blocks are parsed using Babel.

Table of contents

Why use this?

If your team uses Git (or similar) to track and share your Bruno collections, nobody wants to waste time discussing cosmetic formatting! Your energy is better spent thinking about the actual tests.

If one person happens to use 4-space indentation but another person uses 2, there is a chance that PRs descend into a tug of war over time; Each subsequent pull request undoing the previous persons indentation, leading to dozens of unnecessary cosmetic changes that distract the reviewer from focussing on the important changes that actually have a material impact on what is being tested.

Style choices

Thankfully, Bruno is already somewhat opinionated about code style so this project can follow its lead. In the desktop app, when editing a JSON body there is a "Prettify" button which always reformats JSON with 2-space indentation.

There is no adjascent option to reformat the "script" or "tests" tabs, so for JavaScript I've had to pick a set of style rules which I think most closely fit with what a QAer would want... familiar and short.

For JavaScript I've gone with the same 2-space indentation as JSON, no semi-colons at the end of lines for cleanliness and double-quotes for strings so you can copy and paste chunks between JavaScript and JSON without having to change all the quotes.

Feedback

I have developed this package in my free time to help all the QA people living through the industry transition from being manual testers to becoming Test Engineers. If you're suddenly sharing hundreds of Bruno files with teammates, you all need to learn good Git etiquette. Code formatters can remove a lot of the stress.

Please use this package on your team's repos and give me any ideas, feedback or bug reports via the "Issues" tab on the Git repo https://github.com/martinjoiner/prettify-bru

Thanks, Martin

Installation

Requires Node.js 20+

To install in your project, run:

npm i prettify-bru

Boom, now you should be ready to go!

How to use prettify-bru

Basic report

Get a non-destructive report of all files that could potentially be re-formatted by running:

npx prettify-bru

The above command will walk all subdirectories, finding .bru files and display a report. It will not modify the files.

Fixing the files

To actually modify the files, I recommend committing your changes before doing this, add the --write option to the command:

npx prettify-bru --write

⚠️ Including the --write option will modify the files in place, use with caution.

Limit to one directory

To limit the file search to a single subdirectory, provide the path as an argument. For example to search the folder named "speed-tests" do:

npx prettify-bru speed-tests

Limit to one file

Similar to above example, you can also provide a specific filename:

npx prettify-bru speed-tests/get-all.bru

Limit to one block type

Use the --only option to just operate on 1 block type and ignore the rest. For example to only assess the body:json blocks do:

npx prettify-bru --only body:json

Complex example

Fix the formatting of just the body:json block in 1 specific file:

npm prettify-bru --write --only body:json speed-tests/get-all.bru

Automatically checking PRs

You may want to configure Github workflows to run prettify-bru whenever a pull-request is raised. If the files are all formatted correctly the action will display in green, otherwise it will show as red to indicate the PR needs to be fixed.

This works because the prettify-bru command returns exit code 1 if it finds any files that contain an error or require reformatting. Otherwise it will return exit code 0.

Setup Github Workflows from the "Actions" tab of your repository.