{"id":13426055,"url":"https://github.com/gja/cloudflare-worker-local","last_synced_at":"2025-12-25T14:24:16.893Z","repository":{"id":33276316,"uuid":"157443216","full_name":"gja/cloudflare-worker-local","owner":"gja","description":"Run a Cloudflare Worker Locally","archived":false,"fork":false,"pushed_at":"2024-04-23T19:16:19.000Z","size":1447,"stargazers_count":188,"open_issues_count":17,"forks_count":40,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-18T05:24:08.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gja.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-11-13T20:38:14.000Z","updated_at":"2025-10-09T07:24:11.000Z","dependencies_parsed_at":"2024-06-19T00:28:04.475Z","dependency_job_id":null,"html_url":"https://github.com/gja/cloudflare-worker-local","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/gja/cloudflare-worker-local","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gja%2Fcloudflare-worker-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gja%2Fcloudflare-worker-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gja%2Fcloudflare-worker-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gja%2Fcloudflare-worker-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gja","download_url":"https://codeload.github.com/gja/cloudflare-worker-local/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gja%2Fcloudflare-worker-local/sbom","scorecard":{"id":428644,"data":{"date":"2025-08-11","repo":{"name":"github.com/gja/cloudflare-worker-local","commit":"fbd01cec3147e03bf4701b7547f56b8f663881eb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"Code-Review","score":5,"reason":"Found 9/16 approved changesets -- score normalized to 5","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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 23 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":"42 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","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-h452-7996-h45h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"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-19T02:49:12.171Z","repository_id":33276316,"created_at":"2025-08-19T02:49:12.171Z","updated_at":"2025-08-19T02:49:12.171Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28031093,"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-12-25T02:00:05.988Z","response_time":58,"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":[],"created_at":"2024-07-31T00:01:25.338Z","updated_at":"2025-12-25T14:24:16.834Z","avatar_url":"https://github.com/gja.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Tool"],"sub_categories":[],"readme":"# cloudflare-worker-local\nRun (or test) a Cloudflare Worker Locally. If you are looking for a project that will quickly help you bootstrap your worker, take a look at [create-cloudflare-worker](https://github.com/gja/create-cloudflare-worker)\n\n## Running\n\n```shell\n$ npm install -g cloudflare-worker-local\n$ cloudflare-worker-local /path/to/worker.js localhost:3000 4000\n\nListening on Port 4000 and forwarding requests to http://localhost:3000/\n```\n\n## Automatically reloading\n\nIt is possible to use nodemon to automatically reload the worker\n\n```shell\n$ npm install -g nodemon\n$ nodemon --watch /path/to/worker.js --signal SIGHUP --exec 'cloudflare-worker-local /path/to/worker.js localhost:3000 4000'\n```\n\n## Unit Testing a Cloudflare Worker\n\n`cloudflare-worker-local` can be used to unit test a cloudflare worker. Please see [This Example](examples/unit-test-a-worker). You may also be interested in [create-cloudflare-worker](https://github.com/gja/create-cloudflare-worker)\n\n## Things that are supported (and in scope)\n\n* Anything in Node.js scope by default (Object, Array)\n* Anything provided by fetch (fetch, Request, Response, Headers)\n* WHATWG URL\n* console\n* btoa / atob\n* crypto.subtle\n* Cloudflare key value store if you pass in the KV_NAMESPACE environment variable\n* Cloudflare [event.passThroughOnException()](https://workers.cloudflare.com/docs/reference/workers-concepts/fetch-event-lifecycle/#passthroughonexception) for runtime exception handling\n* Cloudflare Environment Variables and Secrets loaded from a wrangler.toml\n* Workers Sites\n* Set cloudflare `CF-IPCountry` header value from `COUNTRY` environment variable (default is `DEV`)\n* ... this list should probably have more things\n\n## Contributors\n\n* Tejas Dinkar (@gja)\n* Jeremy Danyow (@jdanyow)\n* Rita Liu (@rita-liu)\n* Nolan Woods (@innovate-invent)\n* Brendan Coll (@mrbbot)\n\n## Future enhancements\n\n* Support WASM\n* Support CPU timeouts\n* Better Examples\n\n## Environment Variables\n\n* NUM_WORKERS - Specifies the number of node workers (default 1, to get KV Working in memory)\n* KV_NAMESPACES - A comma separated list of keyspaces. (ex: MY_STORE,ANOTHER_STORE)\n\n## CloudFlare KV Store emulation using Minio or any S3 compatible service\n\nTo enable Minio as the KV store simply provide these options as environment variables:\nMINIO_ENDPOINT, MINIO_ACCESS_KEY, and MINIO_SECRET_KEY\n\n```shell script\n$ MINIO_ENDPOINT=\"localhost\" MINIO_ACCESS_KEY=\"my_access_key\" MINIO_SECRET_KEY=\"my_secret\" cloudflare-worker-local /path/to/worker.js localhost:3000 4000\n```\n\nOptionally, these variables are available as well: \nMINIO_PORT, MINIO_USE_SSL, MINIO_REGION, MINIO_TRANSPORT, MINIO_SESSIONTOKEN, and MINIO_PARTSIZE \n\nSee [the Minio documentation](https://docs.min.io/docs/javascript-client-api-reference.html) for details on the various parameters.\n\n## CloudFlare KV Store emulation using the File System\n\nTo use the File System as the KV store simply provide the KV_FILE_ROOT option as an environment\nvariable. A directory will be created in here for each KV namespace.\n\n## CloudFlare Environment Variables and Secrets\n\nSupport for CloudFlare Environment Variables and Secrets is provided via a wrangler.toml file.\nSee the [wrangler documentation](https://developers.cloudflare.com/workers/tooling/wrangler/configuration)\nfor more information on the file schema.\n\nTo load the wrangler.toml, specify it on the command line:\n```shell\n$ cloudflare-worker-local /path/to/worker.js localhost:3000 4000 /path/to/wrangler.toml\n```\n\nOptionally, the desired environment specified within the wrangler.toml can be loaded:\n```shell\n$ cloudflare-worker-local /path/to/worker.js localhost:3000 4000 /path/to/wrangler.toml production\n```\n\nSecrets are specified under the 'secrets' root key in the document. See the [wrangler.toml](./examples/wrangler.toml) \nfor an example of the supported structures.\n\nTwo features are provided while loading the wrangler.toml:\n* All vars and secrets strings can contain ${} placeholders.\n  A placeholder path is resolved using lodash.get and has the context of the root of the config document.\n  A placeholder can not refer to a value defined later in the document that also has placeholders.\n* Any var or secret that is not a string will be automatically JSON encoded. \n  This allows you to inject complex data into a script by JSON decoding the variable value.\n\nAdditionally, any 'kv-namespaces' in the wrangler.toml will be appended to the list of namespaces\nprovided by KV_NAMESPACES.\n\n## Workers Sites\n\nIf a wrangler.toml file containing a `[site]` section with a `bucket` directory is loaded, the Workers Sites\ndefault KV namespace and manifest will be added to the worker's scope. Calls to `getAssetFromKV` will always\nreturn the latest version of an asset in the `bucket` directory. Note that you'll need to bundle your worker\ncode (with Webpack for instance) before running it to use `@cloudflare/kv-asset-handler`, as `import`/\n`require` are not in workers' scopes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgja%2Fcloudflare-worker-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgja%2Fcloudflare-worker-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgja%2Fcloudflare-worker-local/lists"}