mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-09 06:55:03 +00:00
* fix: storing status in example for yml file * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: temporary check for tests * fix: test cases for status and statusText * chore: removed logs * fix: test cases for response status and text * fix: test cases for response status and text * fix: resolved comments * fix: openapi test import test cases * chore: removed console logs * fix: status type in response example while import/export of collection * fix: postman to bruno import --------- Co-authored-by: shubh-bruno <shubh-bruno@shubh-bruno.local>
Bruno Filestore
A generic file storage and parsing package for Bruno API client.
Purpose
This package abstracts the file format operations for Bruno, providing a clean interface for parsing and stringifying Bruno requests, collections, folders, and environments.
Features
- Format-agnostic APIs for file operations
- Currently supports Bruno's custom
.bruformat - Designed for future extensibility to support YAML and other formats
Usage
const {
parseRequest,
stringifyRequest,
parseCollection,
stringifyCollection,
parseEnvironment,
stringifyEnvironment,
parseDotEnv
} = require('@usebruno/filestore');
// Parse a .bru request file
const requestData = parseRequest(bruContent);
// Stringify request data to .bru format
const bruContent = stringifyRequest(requestData);
// Example with future format support (not yet implemented)
const requestData = parseRequest(yamlContent, { format: 'yaml' });
API
The package provides the following functions:
parseRequest(content, options = { format: 'bru' }): Parse request file contentstringifyRequest(requestObj, options = { format: 'bru' }): Convert request object to file contentparseCollection(content, options = { format: 'bru' }): Parse collection file contentstringifyCollection(collectionObj, options = { format: 'bru' }): Convert collection object to file contentparseFolder(content, options = { format: 'bru' }): Parse folder file contentstringifyFolder(folderObj, options = { format: 'bru' }): Convert folder object to file contentparseEnvironment(content, options = { format: 'bru' }): Parse environment file contentstringifyEnvironment(envObj, options = { format: 'bru' }): Convert environment object to file contentparseDotEnv(content): Parse .env file content