{"id":15415022,"url":"https://github.com/sukkaw/kv4cf","last_synced_at":"2025-10-04T05:32:48.002Z","repository":{"id":96342356,"uuid":"269938920","full_name":"SukkaW/kv4cf","owner":"SukkaW","description":"A Modified version of cloudflare/kv-asset-handler, with Non-ASCII URL supported.","archived":false,"fork":false,"pushed_at":"2020-09-02T16:42:29.000Z","size":6,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T04:36:46.531Z","etag":null,"topics":["cloudflare","cloudflare-kv","cloudflare-workers"],"latest_commit_sha":null,"homepage":"","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/SukkaW.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}},"created_at":"2020-06-06T09:56:59.000Z","updated_at":"2021-10-12T22:15:27.000Z","dependencies_parsed_at":"2024-02-08T03:33:19.464Z","dependency_job_id":null,"html_url":"https://github.com/SukkaW/kv4cf","commit_stats":null,"previous_names":["sukkaw/cloudflare-kv-handler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SukkaW/kv4cf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fkv4cf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fkv4cf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fkv4cf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fkv4cf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SukkaW","download_url":"https://codeload.github.com/SukkaW/kv4cf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SukkaW%2Fkv4cf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278267937,"owners_count":25958954,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cloudflare","cloudflare-kv","cloudflare-workers"],"created_at":"2024-10-01T17:05:36.818Z","updated_at":"2025-10-04T05:32:47.979Z","avatar_url":"https://github.com/SukkaW.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kv4cf\n\nA modified version of [`@cloudflare/kv-asset-handler`](https://www.npmjs.com/package/@cloudflare/kv-asset-handler).\n\n[![](https://img.shields.io/npm/v/kv4cf.svg?style=flat-square)](https://www.npmjs.com/package/kv4cf) ![](https://img.shields.io/npm/dt/kv4cf?style=flat-square) ![](https://img.shields.io/npm/l/kv4cf.svg?style=flat-square)\n\n\n## Features\n\n- Non-ASCII URL supported\n- Correct ETag logic (The implementation of `@cloudflare/kv-asset-handler` is broken)\n- Better performance for large scale of website\n\n## Installation\n\n```bash\n# @cloudflare/kv-asset-handler go away\nnpm uninstall @cloudflare/kv-asset-handler\n# Say hello to kv4cf\nnpm install kv4cf\n```\n\n## Usage\n\nNearly exactly the same as `@cloudflare/kv-asset-handler`, so please refer to [its README](https://www.npmjs.com/package/@cloudflare/kv-asset-handler).\n\nOnly a few differences need to be noticed:\n\n### Use CommonJS instead of ESModule\n\n```javascript\n// What you should do to import @cloudflare/kv-asset-handler\nimport { getAssetFromKV } from '@cloudflare/kv-asset-handler'\n\n// What you should do to import kv4cf\nconst { getAssetFromKV } = require('kv4cf');\n```\n\n### Custom Error handling\n\n```javascript\nconst { getAssetFromKV } = require('kv4cf');\nconst { NotFoundError, MethodNotAllowedError, InternalError } = require('kv4cf/lib/error');\n\naddEventListener('fetch', event =\u003e {\n  event.respondWith(handleEvent(event))\n})\n\nasync function handleEvent(event) {\n  try {\n    return await getAssetFromKV(event)\n  } catch (e) {\n    if (e instanceof NotFoundError) {\n      // ...\n    } else if (e instanceof MethodNotAllowedError) {\n      // ...\n    } else if (e instanceof InternalError) {\n      // ...\n    } else {\n      // ...\n    }\n  }\n}\n```\n\n## Author\n\n**kv4cf** © [Sukka](https://github.com/SukkaW), Released under the [MIT](./LICENSE) License.\n\n\u003e [Personal Website](https://skk.moe) · [Blog](https://blog.skk.moe) · GitHub [@SukkaW](https://github.com/SukkaW) · Telegram Channel [@SukkaChannel](https://t.me/SukkaChannel) · Twitter [@isukkaw](https://twitter.com/isukkaw) · Keybase [@sukka](https://keybase.io/sukka)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Fkv4cf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukkaw%2Fkv4cf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukkaw%2Fkv4cf/lists"}