1.0.8 • Published 4 months ago

convert-pino-request-to-curl v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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, ["password"]),
      };
     },
    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

1.0.2

4 months ago

1.0.1

4 months ago

1.0.8

4 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.3

4 months ago

1.0.0

9 months ago

0.0.29

2 years ago

0.0.28

3 years ago

0.0.27

3 years ago

0.0.26

3 years ago

0.0.25

3 years ago

0.0.24

3 years ago

0.0.23

3 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago