This repository has been archived by the owner on Dec 3, 2021. 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.
feat: implement postman collection converter (#1)
- Loading branch information
Showing
21 changed files
with
1,109 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
# @neuralegion/postman2har | ||
|
||
Service lib description | ||
Transform you Postman collection to a series of HAR request objects. | ||
|
||
- https://schema.getpostman.com/collection/json/v2.1.0/draft-07/docs/index.html | ||
- http://www.softwareishard.com/blog/har-12-spec/#request | ||
|
||
## Setup | ||
|
||
```bash | ||
npm i --save @neuralegion/postman2har | ||
``` | ||
|
||
## 🚀 Usage | ||
|
||
Using as a ES module: | ||
|
||
```js | ||
import { postman2har } from '@neuralegion/postman2har'; | ||
import collection from 'your-postman-collection.json'; | ||
|
||
postman2har(collection).then((requests) => { | ||
console.log(requests); | ||
}); | ||
``` | ||
|
||
If you want to pass additional data to resolve environment variables you can pass them via options: | ||
```js | ||
postman2har(collection, { | ||
environment: { baseUrl: 'https://example.com' } | ||
}).then((requests) => { | ||
console.log(requests); | ||
}); | ||
``` | ||
|
||
## 📝License | ||
|
||
Copyright © 2020 [NeuraLegion](https://github.com/NeuraLegion). | ||
|
||
This project is licensed under the MIT License - see the [LICENSE file](LICENSE) for details. |
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
Empty file.
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,5 @@ | ||
import HarV1 from 'har-format'; | ||
|
||
export interface Converter { | ||
convert(collection: Postman.Collection): Promise<HarV1.Request[]>; | ||
} |
Oops, something went wrong.