Installations
npm install nestjs-convert-to-curl
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
18.18.0
NPM Version
9.8.1
Score
59
Supply Chain
84.3
Quality
77.1
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
Download Statistics
Total Downloads
28,147
Last Day
26
Last Week
231
Last Month
1,503
Last Year
6,408
GitHub Statistics
9 Stars
39 Commits
3 Watching
1 Branches
2 Contributors
Bundle Size
163.20 kB
Minified
40.89 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
nestjs-convert-to-curl@1.0.0
Unpacked Size
16.50 kB
Size
4.50 kB
File Count
14
NPM Version
9.8.1
Node Version
18.18.0
Publised On
12 Oct 2024
Total Downloads
Cumulative downloads
Total Downloads
28,147
Last day
-50.9%
26
Compared to previous day
Last week
-40.2%
231
Compared to previous week
Last month
237.8%
1,503
Compared to previous month
Last year
-51.5%
6,408
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
5
Covert Axios error to curl
1$ npm i nestjs-convert-to-curl
Usage
1// main.ts 2// if your prefer to use in a global application 3 4import { LogAxiosErrorInterceptor } from 'nestjs-convert-to-curl'; 5 6async function bootstrap() { 7 ..... 8 app.useGlobalInterceptors(new LogAxiosErrorInterceptor()); 9} 10
1curl --location -g --request POST 'http://url' --header 'Accept: application/json, text/plain, */*' --header 'Content-Type: application/json' --header 'User-Agent: axios/0.26.0' --header 'Content-Length: 13' --data-raw '{"foo":"bar"}'
1// service.ts 2// If you prefer to use in a service. 3 4import { AxiosConverter } from "nestjs-convert-to-curl"; 5 6try { 7 return await Axios.post( 8 "http://www.mymockservice.com", 9 { 10 foo: "bar", 11 password: "123mudar", 12 employee: { name: "Mike", cpf: "41288055800" }, 13 }, 14 { headers: { Authorization: "Bearer token" } } 15 ); 16} catch (error) { 17 console.log(AxiosConverter.getCurl(error)); 18}
1curl --location -g --request POST 'http://www.mymockservice.com' --header 'Accept: application/json, text/plain, */*' --header 'Content-Type: application/json' --header 'Authorization: Bearer token' --header 'User-Agent: axios/1.6.7' --header 'Content-Length: 82' --header 'Accept-Encoding: gzip, compress, deflate, br' --data-raw '{"foo":"bar","password":"******","employee":{"name":"Mike","cpf":"******"}}'
The following is a list of all the people that have contributed to nestjs-convert-to-curl. Thanks for your contributions!
License
It is available under the MIT license. License
No vulnerabilities found.
No security vulnerabilities found.