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

@k-int/bruno-shared-scripts

v2.0.1

Published

This is a public NPM module dedicated to any shared behaviour required across varying collections in Bruno. For now it focuses mostly on connecting to a remote FOLIO instance and managing FOLIO headers, but there is nothing tying this module to only servi

Readme

Bruno shared scripts

This is a public NPM module dedicated to any shared behaviour required across varying collections in Bruno. For now it focuses mostly on connecting to a remote FOLIO instance and managing FOLIO headers, but there is nothing tying this module to only serving those purposes.

Motivation

Analogous to Postman's shared scripts cloud library, Bruno instead allows ANY NPM to be imported (In developer mode, via require) and used within pre/post request scripts. This is significantly more powerful and open, and allows us to publish the module onto the public NPM with strict versioning and be more in control.

Setup

To use the shared scripts within a collection, simply import and initialise them.

const {
  init,
} = require('@k-int/bruno-shared-scripts');

init({
  bruInstance: bru,
  logger: console,
  requestInstance: req
})

This init is a new requirement for Bruno V3, as the virtual environment the scripts are running in have now been configured in such a way that third party modules do not get access to the globals previously available (bru, req), and access to the console in Bruno's developer tools is ALSO siloed.

To combat this, init at the collection level in the pre-request script will ensure that the module is able to access the functionality.

How it works

The module is developed as an ES module, but needs to be built for publishing. This happens via the npm run build. This will overwrite the es directory, creating a single index.js file that can then be required by Bruno scripts.

Development

Since this is an NPM, and Bruno collections can be built with NPM using a package.json, this can be run in a workspace for "easy" development. However developing this module is not completely straightforward, and can take a while

Working in a workspace

If working in an NPM workspace, as per bienenvolk-bruno-workspace, then the development process is:

  • Make changes to shared scripts
  • Run build
  • Restart Bruno GUI
    • IMPORTANT, Bruno caches the NPMs it's using per session, so any changes will NOT be visible until a restart
  • Run request
  • Go back to step 1

Working without a workspace

The development process is largely the same as working in a workspace, with the only difference being that the version will need to point at the newest version

  • Edit Bruno collection package.json to point the bruno-shared-scripts at file:path/to/file
  • Run build for shared scripts
  • clean npm install in the collection (Delete package lock and node_modules to be sure)
  • Restart Bruno GUI
    • IMPORTANT, Bruno caches the NPMs it's using per session, so any changes will NOT be visible until a restart
  • Run request
  • Go back to step 2

And finally remembering to revert the version pointer at the end when the fixed shared-scripts have been published.

Bruno globals

As of Bruno V3, access to bru, req and console will no longer behave as expected within a shared NPM. The solution to this is (for now) a file called bruno-globals-provider. This sets up a setGlobals method which in turn is used by init (I wanted to keep the globals setter separate from the init in case we have side effects down the road).

Then in each helper method, the requisite getter(s) can be used:

import { getBru, getConsole, getReq } from '../bruno-globals-provider.js';

const helloWorld = () => {
  const bru = getBru();
  const logger = getConsole();
  const req = getReq();
  
  logger.log("Hello world");
  logger.log("Request: %o", req);
  
  logger.log("Access Bruno functionality: %o", bru.getEnv("FAKE_ENVIRONMENT_VARIABLE"));
}

Should post-request script helpers be needed, this will need to be extended to include res as well.