{"id":17703223,"url":"https://github.com/fouad/deploy-worker","last_synced_at":"2025-03-13T06:31:50.548Z","repository":{"id":145443577,"uuid":"183958835","full_name":"fouad/deploy-worker","owner":"fouad","description":"Easiest way to compile and deploy Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2019-04-30T18:14:10.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T10:58:07.624Z","etag":null,"topics":["cloudflare","cloudflare-workers","serverless","workers"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fouad.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-04-28T21:05:19.000Z","updated_at":"2023-03-08T04:26:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"42db6314-24db-4c6c-a6a1-9f4bb870b524","html_url":"https://github.com/fouad/deploy-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouad%2Fdeploy-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouad%2Fdeploy-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouad%2Fdeploy-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fouad%2Fdeploy-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fouad","download_url":"https://codeload.github.com/fouad/deploy-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243357603,"owners_count":20277988,"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":["cloudflare","cloudflare-workers","serverless","workers"],"created_at":"2024-10-24T20:05:52.895Z","updated_at":"2025-03-13T06:31:50.535Z","avatar_url":"https://github.com/fouad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e\u003ccode\u003e🌤 deploy-worker\u003c/code\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Easiest way to compile \u003cbr/\u003e\n  and deploy Cloudflare Workers.\n\u003c/p\u003e\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/deploy-worker\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/deploy-worker.svg?maxAge=3600\u0026label=deploy-worker\u0026colorB=007ec6\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n```console\ndeploy-worker --zone-id {zone-id} worker.js\n```\n\n#### Installation\n\nInstall with npm:\n\n```console\nnpm install --global deploy-worker\n```\n\nOr yarn:\n\n```console\nyarn global add deploy-worker\n```\n\n#### Authentication\n\nYou need to pass in `CF_EMAIL` and `CF_AUTH_Key` as environment variables and then you can set `CF_ZONE_ID`/`--zone-id` and optionally `CF_ACCOUNT_ID`/`--acount-id` if you're an Enterprise customer.\n\n#### Usage\n\n**Requirements**\n\n- Cloudflare Account\n- [Cloudflare Auth Key](https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-) and [Zone ID](https://developers.cloudflare.com/workers/api/#zone-id)\n\nCreate a `package.json` to install modules you're using:\n\n```js\n{\n  \"dependencies\": {\n    \"node-emoji\": \"^1.1.0\",\n    \"qs\": \"^6.7.0\"\n  }\n}\n```\n\nThen create your `.js` or `.ts` file, like `worker.js`:\n\n```js\nimport { parse } from 'qs'\nimport { get as getEmoji } from 'node-emoji'\n\naddEventListener('fetch', event =\u003e {\n  let { request } = event\n  let query = parse(request.url.split('?')[1] || '')\n  let qsEmoji = query.emoji || 'star'\n  let emoji = getEmoji(qsEmoji)\n\n  event.respondWith(new Response(emoji))\n})\n```\n\nMake sure your dependencies are installed, then run `deploy-worker` like this:\n\n```console\ndeploy-worker --zone-id {zone-id} worker.js\n```\n\nCongrats! You've deployed a Cloudflare Worker 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouad%2Fdeploy-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffouad%2Fdeploy-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffouad%2Fdeploy-worker/lists"}