1.8.2 • Published 5 months ago
curl-to-postmanv2 v1.8.2
A cURL to POSTMan converter.
Current CURL options that are supported are:
-A, --user-agent
-d, --data
--data-binary
-F, --form
-G, --get
-H, --header
-X, --request
Installation
npm install curl-to-postmanv2
Usage Examples of the Lib:
1. Validate function: Helps you to validate the curl command.
const { validate } = require("curl-to-postmanv2");
let v = validate("curl -X https://google.co.in");
console.log(v); // { result: true }
2. Convert Function: Helps to convert curl to postman
const { convert } = require("curl-to-postmanv2");
let con = convert(
{ type: "string", data: "curl https://google.co.in" },
(err, result) => {
if (err) {
console.log(err);
process.exit(1);
}
console.log(result);
console.log("data: ", result.output[0].data);
}
);
3. getMetaData Function: To get meta data for the curl request
const { getMetaData } = require("curl-to-postmanv2");
let meta = getMetaData(
{ type: "string", data: "curl https://google.co.in" },
(err, result) => {
if (err) {
console.log(err);
process.exit(1);
}
console.log(result);
console.log("data: ", result.output[0].data);
}
);
Usage examples:
Read spec.json and store the output in output.json after grouping the requests into folders
./curl2postman -s spec.json -o output.json -g
Read spec.json and print the output to the console
./curl2postman -s spec.json
Read spec.json and print the prettified output to the console
./curl2postman -s spec.json -p
1.8.2
5 months ago
1.8.1
1 year ago
1.8.0
1 year ago
1.7.1
2 years ago
1.7.0
2 years ago
1.6.0
2 years ago
1.5.0
2 years ago
1.4.0
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.3
2 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.1.1-beta.0
3 years ago
1.0.0
4 years ago
0.5.1
5 years ago
0.5.0
5 years ago
0.4.0
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.1
6 years ago
0.1.0
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago