0.0.29 • Published 11 months ago

convert-pino-request-to-curl v0.0.29

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Convert Pino request to curl

$ npm i -S convert-pino-request-to-curl

Usage

// pino http config
import { pinoHttp } from 'pino-http';
import { pino } from 'pino';

import { PinoRequestConverter } from 'convert-pino-request-to-curl';

pinoHttp(
  ...
serializers: {
    err: pino.stdSerializers.err,
    req: (req) => {
      return {
        method: req.method,
        curl: PinoRequestConverter.getCurl(req),
      };
     },
    res: pino.stdSerializers.res,
}
...
)
curl --location -g --request GET '[::1]:3000/health' \
--header 'host: [::1]:3000' \
--header 'connection: keep-alive' \
--header 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"' \
--header 'accept: text/plain' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36' \
--header 'sec-ch-ua-platform: "Linux"' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-dest: empty' \
--header 'referer: http://[::1]:3000/docs/' \
--header 'accept-encoding: gzip, deflate, br' \
--header 'accept-language: en-US,en;q=0.9' \
--header 'traceId: 96832c78-bfcb-46ec-8fe7-858c1d23182b'

The following is a list of all the people that have contributed to convert-pino-request-to-curl. Thanks for your contributions!

License

It is available under the MIT license. License

0.0.29

11 months ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago