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

bru-converter

v0.1.0

Published

Convert OpenCollection YAML collections to Bruno .bru format

Downloads

135

Readme

bru-converter

Convert OpenCollection YAML collections (Bruno v3.0+) to Bruno's .bru format for use with the Bruno CLI.

Why

Bruno's UI saves collections in the OpenCollection YAML format starting from v3.0. The Bruno CLI still operates on .bru files. This tool bridges the two: design your collections in Bruno UI, then convert them to .bru for scripting, CI/CD, or any workflow that relies on the CLI.

Installation

npm install -g bru-converter

Or as a project dependency:

npm install bru-converter

CLI

bru-converter <input-dir> [output-dir]

input-dir must contain an opencollection.yml file. output-dir defaults to ./output.

# Convert a collection
bru-converter ./my-collection ./my-bru-collection

# Suppress summary output
bru-converter ./my-collection ./my-bru-collection --quiet

Example output:

Converted 12 requests, 2 environments, 3 folders
Output: ./my-bru-collection
Warnings:
  - users/draft.yml: Missing required field 'http.url' — skipped

Exit code 0 on success (warnings are non-fatal), 1 on error.

Library

import {
  convertCollection,  // filesystem: dir → dir
  convertRequest,     // in-memory: YAML string → .bru string
  convertManifest,    // in-memory: opencollection.yml → bruno.json + collection.bru
  convertFolder,      // in-memory: folder.yml → folder.bru string
  convertEnvironment, // in-memory: environment .yml → .bru string
} from 'bru-converter'

Convert an entire collection

const result = await convertCollection('./my-collection', './output')

console.log(`${result.requestsConverted} requests converted`)
console.log(`${result.environmentsConverted} environments converted`)

for (const warning of result.warnings) {
  console.warn(`[${warning.type}] ${warning.file}: ${warning.message}`)
}

Convert a single request in memory

import { convertRequest } from 'bru-converter'

const yaml = `
info:
  name: Get Users
  type: http
  seq: 1
http:
  method: GET
  url: https://api.example.com/users
  auth:
    type: bearer
    bearer:
      token: "{{api_token}}"
`

const bru = convertRequest(yaml)
// meta {
//   name: Get Users
//   type: http
//   seq: 1
// }
//
// get {
//   url: https://api.example.com/users
//   body: none
//   auth: bearer
// }
//
// auth:bearer {
//   token: {{api_token}}
// }

Input / Output Structure

my-collection/              →    my-bru-collection/
├── opencollection.yml      →    ├── bruno.json
│                                ├── collection.bru
├── environments/           →    ├── environments/
│   └── dev.yml             →    │   └── dev.bru
├── users/                  →    ├── users/
│   ├── folder.yml          →    │   ├── folder.bru
│   ├── get-users.yml       →    │   ├── get-users.bru
│   └── create-user.yml     →    │   └── create-user.bru
└── orders/                 →    └── orders/
    └── list-orders.yml     →        └── list-orders.bru

What Gets Converted

| OpenCollection | .bru output | |---|---| | opencollection.yml | bruno.json + collection.bru | | folder.yml | folder.bru | | Request *.yml | *.bru | | environments/*.yml | environments/*.bru |

Supported request features: all HTTP methods, query/path params, headers, JSON/text/XML/GraphQL/form/multipart/file bodies, bearer/basic/API key/digest/OAuth2/AWS v4/NTLM/WSSE auth, pre-request scripts, post-response scripts, tests, assertions, variables, settings, docs.

Non-fatal warnings are emitted (without stopping conversion) for:

  • Requests missing http.method or http.url — skipped
  • Unrecognized top-level YAML fields — skipped
  • Duplicate request names within a folder — renamed with numeric suffix (-2, -3, …)

Requirements

Development

npm install
npm run build
npm test

License

MIT