{"id":21623568,"url":"https://github.com/saka7/fastify-block-list","last_synced_at":"2026-05-18T07:34:20.478Z","repository":{"id":37269185,"uuid":"291685102","full_name":"Saka7/fastify-block-list","owner":"Saka7","description":"IP-s blockings plugin for fastify","archived":false,"fork":false,"pushed_at":"2020-08-31T18:16:42.000Z","size":79,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T09:49:18.470Z","etag":null,"topics":["blocklist","fastify","fastify-plugin","whitelist"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fastify-block-list","language":"JavaScript","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/Saka7.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}},"created_at":"2020-08-31T10:29:43.000Z","updated_at":"2023-06-22T10:18:52.000Z","dependencies_parsed_at":"2022-08-29T06:21:42.145Z","dependency_job_id":null,"html_url":"https://github.com/Saka7/fastify-block-list","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saka7%2Ffastify-block-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saka7%2Ffastify-block-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saka7%2Ffastify-block-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saka7%2Ffastify-block-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saka7","download_url":"https://codeload.github.com/Saka7/fastify-block-list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244288153,"owners_count":20428938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blocklist","fastify","fastify-plugin","whitelist"],"created_at":"2024-11-25T00:13:23.442Z","updated_at":"2026-05-18T07:34:20.448Z","avatar_url":"https://github.com/Saka7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-block-list\n\nIP-s blocklisting plugin for fastify\n\n## Install\n\n```bash\nnpm i fastify-block-list\n```\n\n## Usage\n\nSimply require this plugin, and set the array of ip addresses to block\n\n```javascript\nconst fastify = require('fastify')()\nconst fastifyBlocklist = require('fastify-block-list')\n\nfastify.register(fastifyBlocklist, {\n  blocklist: ['127.0.0.1'],\n})\n\nfastify.get('/', (req, res) =\u003e {\n  res.send({ ok: true })\n})\n\nfastify.listen(3000, (err, address) =\u003e {\n  if (err) throw err\n  console.log(`Sever is listening on address: ${address}`)\n})\n```\n\nYou can also specify custom error response\n\n\n```javascript\nfastify.register(fastifyBlocklist, {\n  blocklist: ['127.0.0.1'],\n  error: {\n    code: 400,\n    body: 'Custom message',\n  }\n})\n```\n\nOr provide custom error handler function \n\n```javascript\nfastify.register(fastifyBlocklist, {\n  blocklist: ['127.0.0.1'],\n  error: {\n    handler: async (req, reply) =\u003e {\n      reply.code(403).send({error: 'Custom error'})\n    }\n  }\n})\n```\n\nRegular expressions are also supported\n\n```javascript\nfastify.register(fastifyBlocklist, {\n  blocklist: [/^192\\.168\\.\\d{1-3}\\.\\d{1-3}$/],\n})\n```\n\n\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaka7%2Ffastify-block-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaka7%2Ffastify-block-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaka7%2Ffastify-block-list/lists"}