This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
610 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,46 @@ | ||
# bruno2postman | ||
an experimental utility for doing best-effort conversion of Bruno collections | ||
to Postman. I need this for my job :) | ||
an experimental, WIP utility to convert Bruno collections into Postman | ||
collections. | ||
|
||
usage: | ||
``` | ||
bruno2postman <input bruno collection folder> <output postman json file> | ||
``` | ||
|
||
e.g., | ||
``` | ||
bruno2postman ~/Dev/Bruno/StarWarsAPI ./StarWars.json | ||
``` | ||
|
||
## Features | ||
this tool is VERY incomplete, and lacks substantial functionality. i am | ||
building this primarily for the case where you need to give someone a set of | ||
HTTP requests quickly, and they don't use Bruno. | ||
|
||
currently, this handles: | ||
- basic HTTP requests with JSON bodies | ||
- headers | ||
- query params | ||
- folder/hiearchical structure | ||
|
||
it does not support: | ||
- graphql | ||
- non-JSON bodies | ||
- probably other things! | ||
|
||
it will likely never support: | ||
- scripts (I assume these are totally incompatible) | ||
- tests (I assume these are totally incompatible) | ||
|
||
this will also likely **crash and burn** on invalid input data. there is a | ||
substantial lack of error handling at play. you are warned. | ||
|
||
it may also break on valid data! i'm basically reverse engineering what Bruno | ||
can do, because I have no idea how to read their parsing code :). | ||
|
||
## Support | ||
testing on Linux; will probably work on macOS; good luck on Windows (but | ||
please feel free to PR fixes for Windows to get it working) | ||
|
||
## License | ||
Licensed under the MIT License (in the hopes this could be incorporated | ||
upstream) | ||
Licensed under the MIT License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /usr/bin/env node | ||
/* | ||
index.js - main CLI scaffolding of bruno2postman | ||
Copyright (c) 2023 Isaac Trimble-Pederson | ||
Licensed under the MIT License | ||
*/ | ||
|
||
const { program } = require('commander'); | ||
const { bruno2postman } = require('./src/bruno2postman'); | ||
|
||
|
||
program | ||
.argument('<input path>', 'path to bruno collection folder') | ||
.argument('<output path>', 'path to output postman json file'); | ||
|
||
program.parse(); | ||
|
||
const inputPath = program.args[0]; | ||
const outputPath = program.args[1]; | ||
|
||
bruno2postman(inputPath, outputPath); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,28 @@ | |
"version": "0.0.1", | ||
"description": "experimental utility to convert Bruno collections to Postman", | ||
"main": "index.js", | ||
"bin": { | ||
"bruno2postman": "index.js" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"run": "node index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/wtpisaac/bruno2postman.git" | ||
}, | ||
"author": "Isaac Trimble-Pederson <[email protected]>", | ||
"author": "Isaac Trimble-Pederson <[email protected]> (https://wtpisaac.com/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/wtpisaac/bruno2postman/issues" | ||
}, | ||
"homepage": "https://github.com/wtpisaac/bruno2postman#readme" | ||
"homepage": "https://github.com/wtpisaac/bruno2postman#readme", | ||
"volta": { | ||
"node": "18.18.0" | ||
}, | ||
"dependencies": { | ||
"@usebruno/lang": "^0.4.0", | ||
"commander": "^11.0.0", | ||
"postman-collection": "^4.2.1" | ||
} | ||
} |
Oops, something went wrong.