|
1 |
| -## ⛅️ Home to `wrangler`, the CLI for Cloudflare Workers®, as well as other tools for interacting with Workers |
2 |
| - |
3 |
| -This monorepo contains: |
4 |
| - |
5 |
| -- [`wrangler-devtools`](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler-devtools) |
6 |
| - Cloudflare's fork of Chrome DevTools for inspecting your local or remote Workers |
7 |
| -- [`templates`](https://github.com/cloudflare/workers-sdk/tree/main/templates) |
8 |
| - Templates & examples for writing Cloudflare Workers |
9 |
| -- [`wrangler`](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler) |
10 |
| - A command line tool for building [Cloudflare Workers](https://workers.cloudflare.com/). |
11 |
| -- [`pages-shared`](https://github.com/cloudflare/workers-sdk/tree/main/packages/pages-shared) |
12 |
| - Used internally to power Wrangler and Cloudflare Pages. It contains all the code that is shared between these clients. |
13 |
| -- [`C3`](https://github.com/cloudflare/workers-sdk/tree/main/packages/create-cloudflare) A CLI for creating and deploying new applications to Cloudflare. |
14 |
| - |
15 |
| -Wrangler and the workers-sdk is developed in the open on GitHub, and you can see what we're working on in [GitHub Issues](https://github.com/cloudflare/workers-sdk/issues?q=is%3Aopen+is%3Aissue), as well as in our [workers-sdk GitHub Project board](https://github.com/orgs/cloudflare/projects/1). If you've found a bug or would like to request a feature, [please file an issue](https://github.com/cloudflare/workers-sdk/issues/new/choose)! |
| 1 | +<h1 align="center">Cloudflare Workers SDK</h1> |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | +<img src="cloudflare-workers-outline.png" alt="workers-logo" width="120px" height="120px"/> |
| 5 | + <br> |
| 6 | + Cloudflare Workers let you deploy serverless code instantly across the globe for exceptional performance, reliability, and scale. |
| 7 | + <br> |
| 8 | +</p> |
| 9 | + |
| 10 | +<p align="center"> |
| 11 | + <a href="CONTRIBUTING.md">Contribute</a> |
| 12 | + · |
| 13 | + <a href="https://github.com/cloudflare/workers-sdk/issues">Submit an Issue</a> |
| 14 | + · |
| 15 | + <a href="https://discord.cloudflare.com/">Join Discord</a> |
| 16 | + <br> |
| 17 | + <br> |
| 18 | +</p> |
| 19 | + |
| 20 | +<p align="center"> |
| 21 | + <a href="https://www.npmjs.com/wrangler/"> |
| 22 | + <img src="https://img.shields.io/npm/v/wrangler.svg?logo=npm&logoColor=fff&label=NPM+package&color=orange" alt="Wrangler on npm" /> |
| 23 | + </a> |
| 24 | + <a href="https://discord.cloudflare.com/"> |
| 25 | + <img src="https://img.shields.io/discord/595317990191398933.svg?logo=discord&logoColor=fff&label=Discord&color=7389d8" alt="Discord conversation" /> |
| 26 | + </a> |
| 27 | + <a href="https://twitter.com/CloudflareDev"> |
| 28 | + <img src="https://img.shields.io/twitter/follow/cloudflaredev" alt="X conversation" /> |
| 29 | + </a> |
| 30 | +</p> |
| 31 | + |
| 32 | +<hr> |
16 | 33 |
|
17 | 34 | ## Quick Start
|
18 | 35 |
|
19 |
| -```bash |
20 |
| -# Make a javascript file |
21 |
| -echo "export default { fetch() { return new Response('hello world') } }" > index.js |
22 |
| -# try it out |
23 |
| -npx wrangler dev index.js |
24 |
| -# and then deploy it |
25 |
| -npx wrangler deploy index.js --name my-worker --latest |
26 |
| -# visit https://my-worker.<your workers subdomain>.workers.dev |
27 |
| -``` |
28 |
| - |
29 |
| -## Create a Project |
30 |
| - |
31 |
| -```bash |
32 |
| -# Generate a new project |
33 |
| -npx wrangler init my-worker |
34 |
| -# try it out |
35 |
| -cd my-worker && npm run start |
36 |
| -# and then deploy it |
37 |
| -npm run deploy |
38 |
| -``` |
39 |
| - |
40 |
| -## Installation: |
| 36 | +To get started quickly with a new project, run the command below: |
41 | 37 |
|
42 | 38 | ```bash
|
43 |
| -$ npm install wrangler --save-dev |
| 39 | +npx create-cloudflare@latest |
44 | 40 | ```
|
45 | 41 |
|
46 |
| -## Commands |
47 |
| - |
48 |
| -### `wrangler init [name]` |
49 |
| - |
50 |
| -Creates a Worker project. For details on configuration keys and values, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/configuration/). |
51 |
| - |
52 |
| -### `wrangler dev` |
53 |
| - |
54 |
| -Start a local development server, with live reloading and devtools. |
| 42 | +For more info, visit our [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/) guide. |
55 | 43 |
|
56 |
| -### `wrangler deploy` |
| 44 | +## Documentation |
57 | 45 |
|
58 |
| -Deploys the given script to the worldwide Cloudflare network. |
| 46 | +Visit the official Workers documentation [here](https://developers.cloudflare.com/workers/). |
59 | 47 |
|
60 |
| -For more commands and options, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/). |
| 48 | +- [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/) |
| 49 | +- [How Workers works](https://developers.cloudflare.com/workers/reference/how-workers-works/) |
| 50 | +- [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/) |
| 51 | +- [Observability](https://developers.cloudflare.com/workers/observability/) |
| 52 | +- [Platform](https://developers.cloudflare.com/workers/platform/) |
61 | 53 |
|
62 |
| -## Pages |
| 54 | +## Directory |
63 | 55 |
|
64 |
| -### `wrangler pages dev [directory] [-- command]` |
| 56 | +| Package | Description | Links | |
| 57 | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | |
| 58 | +| [`wrangler`](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler) | A command line tool for building [Cloudflare Workers](https://workers.cloudflare.com/). | [Docs](https://developers.cloudflare.com/workers/wrangler/) | |
| 59 | +| [`create-cloudflare (C3)`](https://github.com/cloudflare/workers-sdk/tree/main/packages/create-cloudflare) | A CLI for creating and deploying new applications to Cloudflare. | [Docs](https://developers.cloudflare.com/pages/get-started/c3/) | |
| 60 | +| [`miniflare`](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler-devtools) | A simulator for developing and testing Cloudflare Workers, powered by [workerd](https://github.com/cloudflare/workerd) | [Docs](https://miniflare.dev) | |
| 61 | +| [`wrangler-devtools`](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler-devtools) | Cloudflare's fork of Chrome DevTools for inspecting your local or remote Workers | | |
| 62 | +| [`pages-shared`](https://github.com/cloudflare/workers-sdk/tree/main/packages/pages-shared) | Used internally to power Wrangler and Cloudflare Pages. It contains all the code that is shared between these clients. | | |
65 | 63 |
|
66 |
| -Either serves a static build asset directory, or proxies itself in front of a command. |
| 64 | +In addition to these, this repo contains a selection of [`templates`](https://github.com/cloudflare/workers-sdk/tree/main/templates) to help you get started with a variety of projects. |
67 | 65 |
|
68 |
| -Builds and runs functions from a `./functions` directory or uses a `_worker.js` file inside the static build asset directory. |
| 66 | +## Contributing |
69 | 67 |
|
70 |
| -For more commands and options, refer to the [documentation](https://developers.cloudflare.com/pages/platform/functions#develop-and-preview-locally) or run `wrangler pages dev --help`. |
| 68 | +We welcome new contributors! Refer to the [`CONTRIBUTING.md`](/CONTRIBUTING.md) guide for details. |
71 | 69 |
|
72 |
| -## Documentation |
| 70 | +## Community |
73 | 71 |
|
74 |
| -For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/). |
| 72 | +Join us in the official [Cloudflare Discord](https://discord.cloudflare.com/) to meet other developers, ask questions, or learn more in general. |
75 | 73 |
|
76 |
| -## Contributing |
| 74 | +## Links |
77 | 75 |
|
78 |
| -Refer to the [`CONTRIBUTING.md`](/CONTRIBUTING.md) guide for details. |
| 76 | +- [Project Board](https://github.com/orgs/cloudflare/projects/1) |
| 77 | +- [Discussions](https://github.com/cloudflare/workers-sdk/discussions) |
0 commit comments