{"id":22547067,"url":"https://github.com/kiwilan/fastify-utils","last_synced_at":"2026-04-30T17:31:17.154Z","repository":{"id":86551153,"uuid":"606508868","full_name":"kiwilan/fastify-utils","owner":"kiwilan","description":"Collection of utilities for fastify framework, built to improve DX.","archived":false,"fork":false,"pushed_at":"2023-10-30T02:38:57.000Z","size":521,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-03T03:48:36.123Z","etag":null,"topics":["fastify","typescript","utils"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwilan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"kiwilan"}},"created_at":"2023-02-25T17:50:16.000Z","updated_at":"2023-04-18T11:02:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1022b46-3a7c-44d7-8be7-9e46b8c38fbd","html_url":"https://github.com/kiwilan/fastify-utils","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"1f33f7b3da30bdc63b691fc7b78bf6e26ba3ddef"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/kiwilan/fastify-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Ffastify-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Ffastify-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Ffastify-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Ffastify-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwilan","download_url":"https://codeload.github.com/kiwilan/fastify-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Ffastify-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32472396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["fastify","typescript","utils"],"created_at":"2024-12-07T15:09:58.584Z","updated_at":"2026-04-30T17:31:17.137Z","avatar_url":"https://github.com/kiwilan.png","language":"TypeScript","funding_links":["https://github.com/sponsors/kiwilan"],"categories":[],"sub_categories":[],"readme":"# Fastify utils\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/kiwilan/fastify-utils\" target=\"_blank\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/kiwilan/fastify-utils/main/public/og.jpg\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/kiwilan/fastify-utils/main/public/og.jpg\"\u003e\n      \u003cimg alt=\"Social oEmbed\" src=\"https://raw.githubusercontent.com/kiwilan/fastify-utils/main/public/og.jpg\" width=\"750\" height=\"100%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eCollection of utilities for \u003ca href=\"https://www.fastify.io/\"\u003efastify\u003c/a\u003e framework, built to improve DX.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@kiwilan/fastify-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@kiwilan/fastify-utils.svg?style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"NPM\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@kiwilan/fastify-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/@kiwilan/fastify-utils.svg?style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/kiwilan/fastify-utils/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/kiwilan/fastify-utils.svg?style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.fastify.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/json?label=fastify\u0026url=https://raw.githubusercontent.com/kiwilan/fastify-utils/main/package.json\u0026query=dependencies.fastify\u0026style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"Fastify\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.typescriptlang.org/\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/json?label=typescript\u0026url=https://raw.githubusercontent.com/kiwilan/fastify-utils/main/package.json\u0026query=devDependencies.typescript\u0026style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"TypeScript\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://nodejs.org/en\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/json?label=node.js\u0026url=https://raw.githubusercontent.com/kiwilan/fastify-utils/main/package.json\u0026query=engines.node\u0026style=flat-square\u0026colorA=18181B\u0026colorB=339933\" alt=\"Node.js\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/kiwilan/fastify-utils/actions/workflows/run-tests.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/kiwilan/fastify-utils/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square\u0026colorA=18181B\" alt=\"tests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/kiwilan/fastify-utils\"\u003e\u003cimg src=\"https://codecov.io/gh/kiwilan/fastify-utils/branch/main/graph/badge.svg?token=96OXNK5PV5\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\n```bash\nnpm add @kiwilan/fastify-utils tsx\n```\n\nOr with [pnpm](https://pnpm.js.org/):\n\n```bash\npnpm add @kiwilan/fastify-utils tsx\n```\n\n## Usage\n\n```bash\ntouch setup.js\ntouch .eslintrc\ntouch .env.example\n```\n\n```bash\ncp .env.example .env\n```\n\n### Dev setup\n\nIn `.env`:\n\n```bash\nLOG_LEVEL=debug      # debug | error | fatal  | info | trace | warn | silent\n\nPORT=3000\nBASE_URL=localhost\nHTTPS=false\n\nCLUSTER=false\n```\n\nIn `setup.js`:\n\n```javascript\nimport { Compiler } from \"fastify-utils\";\n\nCompiler.make({\n  // options\n});\n```\n\nIn `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"postinstall\": \"npm run config\",\n    \"config\": \"node setup.js\",\n    \"dev\": \"npm run config \u0026\u0026 NODE_ENV=development tsx watch src .env\"\n  }\n}\n```\n\nIn `src/index.ts`:\n\n```typescript\nimport { Server } from \"fastify-utils\";\n\nServer.run({\n  // options\n});\n```\n\n#### Routes\n\nIn `src/routes/index.ts`:\n\n```typescript\nimport { Route } from \"fastify-utils\";\n\nexport default Route.make({\n  method: \"GET\",\n  url: \"/\",\n  handler: async (request, reply) =\u003e {\n    return { hello: \"world\" };\n  },\n});\n```\n\nAnd for `src/routes/api/posts/index.ts`:\n\n```typescript\nimport { Route } from \"fastify-utils\";\n\nexport default Route.make({\n  method: \"GET\",\n  url: \"/api/posts\", // autocomplete\n  handler: async (request, reply) =\u003e {\n    return { posts: [] };\n  },\n});\n```\n\n#### API key\n\nIn `.env`\n\n```bash\n# Could be left empty if you don't want to use it\nAPI_KEY=\n```\n\n### Build setup\n\nIn `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"rimraf build \u0026\u0026 npm run config \u0026\u0026 NODE_ENV=production tsx setup.js \u0026\u0026 npm run check:types\",\n    \"check:types\": \"tsc --noEmit\"\n  }\n}\n```\n\n### Production setup\n\nIn `.env`:\n\n```bash\nLOG_LEVEL=error      # debug | error | fatal  | info | trace | warn | silent\n\nPORT=3000 # pm2 port\nBASE_URL=domain.com\nHTTPS=true\n```\n\nIn `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"clean\": \"rimraf build \u0026\u0026 rimraf node_modules \u0026\u0026 pnpm install\",\n    \"start\": \"node build/index.mjs\",\n    \"pm2\": \"pm2 start --name 'fastify-utils' './build/index.mjs'\"\n  }\n}\n```\n\n## Build\n\n```bash\npnpm package\n```\n\n```json\n{\n  \"dependencies\": {\n    \"@kiwilan/fastify-utils\": \"file:~/kiwilan-fastify-utils.tgz\"\n  }\n}\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Ffastify-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwilan%2Ffastify-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Ffastify-utils/lists"}