{"id":15492134,"url":"https://github.com/imjuni/jin-curlize","last_synced_at":"2026-02-06T17:33:51.078Z","repository":{"id":57280859,"uuid":"268550576","full_name":"imjuni/jin-curlize","owner":"imjuni","description":"create curl command from FastifyRequest","archived":false,"fork":false,"pushed_at":"2024-02-14T16:06:00.000Z","size":543,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T18:06:26.026Z","etag":null,"topics":["curl","curl-commands","fastify","fastifyjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imjuni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-01T14:49:56.000Z","updated_at":"2023-07-06T04:27:31.000Z","dependencies_parsed_at":"2024-11-14T16:42:16.144Z","dependency_job_id":"740311c4-10d2-4dd0-9e92-e23c9c5e5757","html_url":"https://github.com/imjuni/jin-curlize","commit_stats":{"total_commits":29,"total_committers":3,"mean_commits":9.666666666666666,"dds":0.06896551724137934,"last_synced_commit":"a60a1ede29669cc230dc0cb20b4ca8ffdbd6f642"},"previous_names":["imjuni/jin-curl"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/imjuni/jin-curlize","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fjin-curlize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fjin-curlize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fjin-curlize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fjin-curlize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjuni","download_url":"https://codeload.github.com/imjuni/jin-curlize/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fjin-curlize/sbom","scorecard":{"id":485672,"data":{"date":"2025-08-11","repo":{"name":"github.com/imjuni/jin-curlize","commit":"a60a1ede29669cc230dc0cb20b4ca8ffdbd6f642"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/jin-curlize/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/jin-curlize/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/jin-curlize/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/imjuni/jin-curlize/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-27c6-mcxv-x3fh","Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-rrr8-f88r-h8q6","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T17:42:27.818Z","repository_id":57280859,"created_at":"2025-08-19T17:42:27.818Z","updated_at":"2025-08-19T17:42:27.818Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29170166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","curl-commands","fastify","fastifyjs"],"created_at":"2024-10-02T07:58:59.430Z","updated_at":"2026-02-06T17:33:51.063Z","avatar_url":"https://github.com/imjuni.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jin-curlize\n\n![ts](https://flat.badgen.net/badge/Built%20With/TypeScript/blue)\n[![Download Status](https://img.shields.io/npm/dw/jin-curlize.svg?style=flat-square)](https://npmcharts.com/compare/jin-curlize?minimal=true)\n[![Github Star](https://img.shields.io/github/stars/imjuni/jin-curlize.svg?style=flat-square)](https://github.com/imjuni/jin-curlize)\n[![Github Issues](https://img.shields.io/github/issues-raw/imjuni/jin-curlize.svg?style=flat-square)](https://github.com/imjuni/jin-curlize/issues)\n[![NPM version](https://img.shields.io/npm/v/jin-curlize.svg?style=flat-square)](https://www.npmjs.com/package/jin-curlize)\n[![License](https://img.shields.io/npm/l/jin-curlize.svg?style=flat-square)](https://github.com/imjuni/jin-curlize/blob/master/LICENSE)\n[![ci](https://github.com/imjuni/jin-curlize/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/imjuni/jin-curlize/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/imjuni/jin-curlize/branch/master/graph/badge.svg?style=flat-square\u0026token=R7R2PdJcS9)](https://codecov.io/gh/imjuni/jin-curlize)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\njin-curlize create curl command from FastifyRequest.\n\nWhy?\n\n1. automatic create curl command from FastifyRequest\n1. Quickly retry error request\n1. Support querystring, header, body replacer\n\n## Table of Contents \u003c!-- omit in toc --\u003e\n\n- [How to works?](#how-to-works)\n- [Usage](#usage)\n  - [create curl command](#create-curl-command)\n  - [create axios request configuration](#create-axios-request-configuration)\n- [Example](#example)\n- [Options](#options)\n  - [createFromFastify3](#createfromfastify3)\n  - [createAxiosFromFastify3](#createaxiosfromfastify3)\n- [How do I add x-request-id?](#how-do-i-add-x-request-id)\n- [jin-axios-curlize](#jin-axios-curlize)\n\n## How to works?\n\n`jin-curlize` create curl command from `FastifyRequest`. URL, querystirng, header create using `IncomingMessage` in `FastifyRequest`. For example,\n\n- `IncomingMessage`.`IncomingHttpHeaders` to `--header` option\n- `IncomingMessage`.url to querystring and href\n\nBut `IncomingMessage` is already ended ReadableStream in `FastifyReqest`. So body create using `FastifyRequest`.body.\n\n```mermaid\nflowchart LR\n    IMH[IncomingMessage.IncomingHttpHeaders] --\u003e JC[jin-curlize]\n    IMU[IncomingMessage.url] --\u003e JC\n    FB[FastifyRequest.body] --\u003e JC\n    JC --\u003e C[curl command]\n    JC --\u003e A[AxiosRequestConfig]\n\n```\n\n## Usage\n\n### create curl command\n\n```ts\nimport fastify from 'fastify';\nimport { createFromFastify3 } from 'jin-curlize';\n\nconst server = fastify({\n  logger: {\n    transport: {\n      target: 'pino-pretty',\n    },\n    serializers: {\n      res(reply) {\n        return {\n          statusCode: reply.statusCode,\n        };\n      },\n      req(request) {\n        return {\n          method: request.method,\n          url: request.url,\n          path: request.routerPath,\n          parameters: request.params,\n          headers: request.headers,\n          curl: createFromFastify3(request, { prettify: false }),\n        };\n      },\n    },\n  },\n});\n\nserver.listen({ host: '0.0.0.0', port: 3000 });\n```\n\n### create axios request configuration\n\n```ts\nimport fastify from 'fastify';\nimport { createAxiosFromFastify3 } from 'jin-curlize';\n\nconst fastify = fastify({\n  logger: {\n    transport: {\n      target: 'pino-pretty',\n    },\n    serializers: {\n      res(reply) {\n        return {\n          statusCode: reply.statusCode,\n        };\n      },\n      req(request) {\n        return {\n          method: request.method,\n          url: request.url,\n          path: request.routerPath,\n          parameters: request.params,\n          headers: request.headers,\n          axios: JSON.stringify(createAxiosFromFastify3(request)),\n        };\n      },\n    },\n  },\n});\n\nserver.listen({ host: '0.0.0.0', port: 3000 });\n```\n\n## Example\n\nAxios Request\n\n```js\nawait axios.request({\n  method: 'post',\n  url: `http://localhost:3000/post-form`,\n  headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n  data: querystring.stringify({\n    name: 'ironman',\n    ability: ['energy repulsor', 'supersonic flight'],\n  }),\n});\n```\n\nCreate command\n\n```bash\ncurl -X POST 'http://localhost:3000/post-form' --header 'content-type: application/x-www-form-urlencoded' --data name='ironman' --data ability='energy repulsor' --data ability='supersonic flight'\n```\n\n## Options\n\n### createFromFastify3\n\n| Name                  | Requirement | Description                                                    |\n| --------------------- | ----------- | -------------------------------------------------------------- |\n| prettify              | require     | Apply prettifing. Add newline and backslash add on line-ending |\n| indent                | optional    | Only work on prettify set true, make space size                |\n| disableFollowRedirect | optional    | If set true, remove `--location` option from command           |\n| changeHeaderKey       | optional    | change header key case. eg. `content-type` to `Content-Type`   |\n| replacer.querystring  | optional    | replacer for querystring                                       |\n| replacer.body         | optional    | replacer for body                                              |\n| replacer.header       | optional    | replacer for header                                            |\n\n### createAxiosFromFastify3\n\n| Name                 | Requirement | Description                                                  |\n| -------------------- | ----------- | ------------------------------------------------------------ |\n| changeHeaderKey      | optional    | change header key case. eg. `content-type` to `Content-Type` |\n| replacer.querystring | optional    | replacer for querystring                                     |\n| replacer.body        | optional    | replacer for body                                            |\n| replacer.header      | optional    | replacer for header                                          |\n\n## How do I add x-request-id?\n\n- [Add x-request-id on querystring](https://github.com/imjuni/jin-curlize/blob/master/examples/x-request-id/index.mjs)\n- [Add transaction_id on querystring](https://github.com/imjuni/jin-curlize/blob/master/examples/transaction-id/index.mjs)\n\n## jin-axios-curlize\n\nIf you want that curl command generate from AxiosRequest, use [jin-axios-curlize](https://www.npmjs.com/package/jin-axios-curlize) package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Fjin-curlize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjuni%2Fjin-curlize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Fjin-curlize/lists"}