@@ -10,6 +10,61 @@ Current CURL options that are supported are:
10
10
-H, --header
11
11
-X, --request
12
12
13
+ Installation
14
+
15
+ ``` cli
16
+ npm install curl-to-postmanv2
17
+ ```
18
+
19
+ ** Usage Examples of the Lib:**
20
+
21
+ ** 1. Validate function** : Helps you to validate the curl command.
22
+
23
+ ``` js
24
+ const { validate } = require (" curl-to-postmanv2" );
25
+
26
+ let v = validate (" curl -X https://google.co.in" );
27
+ console .log (v); // { result: true }
28
+ ```
29
+
30
+ ** 2. Convert Function** : Helps to convert curl to postman
31
+
32
+ ``` js
33
+ const { convert } = require (" curl-to-postmanv2" );
34
+
35
+ let con = convert (
36
+ { type: " string" , data: " curl https://google.co.in" },
37
+ (err , result ) => {
38
+ if (err) {
39
+ console .log (err);
40
+
41
+ process .exit (1 );
42
+ }
43
+ console .log (result);
44
+ console .log (" data: " , result .output [0 ].data );
45
+ }
46
+ );
47
+ ```
48
+
49
+ ** 3. getMetaData Function** : To get meta data for the curl request
50
+
51
+ ``` js
52
+ const { getMetaData } = require (" curl-to-postmanv2" );
53
+
54
+ let meta = getMetaData (
55
+ { type: " string" , data: " curl https://google.co.in" },
56
+ (err , result ) => {
57
+ if (err) {
58
+ console .log (err);
59
+
60
+ process .exit (1 );
61
+ }
62
+ console .log (result);
63
+ console .log (" data: " , result .output [0 ].data );
64
+ }
65
+ );
66
+ ```
67
+
13
68
Usage examples:
14
69
15
70
Read spec.json and store the output in output.json after grouping the requests into folders
@@ -19,4 +74,4 @@ Usage examples:
19
74
./curl2postman -s spec.json
20
75
21
76
Read spec.json and print the prettified output to the console
22
- ./curl2postman -s spec.json -p
77
+ ./curl2postman -s spec.json -p
0 commit comments