Inbuilt Libraries
Bruno supports CommonJS syntax require
for importing libraries. ES Modules import/export
are not supported at this time.
Here’s an example demonstrating how to use the chai library in Bruno:
const chai = require('chai');
const { expect } = chai;
function add(a, b) {
return a + b;
}
const result = add(2, 3);
expect(result).to.equal(5);
console.log('Test passed!');
You can include this code in the pre-request script section of Bruno to test it out.
Below is the list of inbuilt libraries supported by Bruno.
- axios (opens in a new tab) - Promise based HTTP client for the browser and node.js
- atob (opens in a new tab) - Turn base64-encoded ascii data back to binary.
- btoa (opens in a new tab) - Turn binary data to base64-encoded ascii.
- chai (opens in a new tab) - BDD/TDD assertion library for node.js and the browser.
- moment (opens in a new tab) - Parse, validate, manipulate, and display dates and times in JavaScript.
- uuid (opens in a new tab) - For the creation of RFC4122 UUIDs.
- nanoid (opens in a new tab) - A tiny, secure, URL-friendly, unique string ID generator for JavaScript.
- crypto-js (opens in a new tab) - JavaScript library of crypto standards.
⚠️
To use below inbuilt libraries in Bruno, you must be in Developer Mode.
- node-fetch (opens in a new tab) - A light-weight module that brings Fetch API to Node.js.
- lodash (opens in a new tab) - A modern JavaScript utility library delivering modularity, performance & extras.
- ajv (opens in a new tab) - Ajv JSON schema validator.