Skip to content

Commit 914290b

Browse files
Spruce up the Wrangler NPM README a tad (#7271)
--------- Co-authored-by: lrapoport-cf <[email protected]>
1 parent 113a359 commit 914290b

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

packages/wrangler/README.md

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,57 @@
1414
1515
## Quick Start
1616

17+
To get started quickly with a Hello World worker, run the command below:
18+
1719
```bash
18-
# Make a javascript file
19-
echo "export default { fetch() { return new Response('hello world') } }" > index.js
20-
# try it out
21-
npx wrangler dev index.js
22-
# and then deploy it
23-
npx wrangler deploy index.js --name my-worker
24-
# visit https://my-worker.<your workers subdomain>.workers.dev
20+
npx wrangler init my-worker -y
2521
```
2622

27-
## Create a Project
23+
For more info, visit our [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/) guide.
2824

29-
```bash
30-
# Generate a new project
31-
npx wrangler init my-worker --no-delegate-c3
32-
# try it out
33-
cd my-worker && npm run start
34-
# and then deploy it
35-
npm run deploy
36-
```
25+
## Documentation
3726

38-
## Installation:
27+
For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).
3928

40-
```bash
41-
$ npm install wrangler --save-dev
42-
```
29+
To read more about Workers in general:
4330

44-
## Configuration:
31+
- [Getting Started](https://developers.cloudflare.com/workers/get-started/guide/)
32+
- [How Workers works](https://developers.cloudflare.com/workers/reference/how-workers-works/)
33+
- [Observability](https://developers.cloudflare.com/workers/observability/)
34+
- [Platform](https://developers.cloudflare.com/workers/platform/)
4535

46-
Wrangler is configured via a `wrangler.json` or `wrangler.toml` file in the project root. When utilizing the `wrangler init` command, a `wrangler.toml` file will be created for you.
36+
## Configuration
4737

48-
Example:
38+
Wrangler is configured via a `wrangler.toml` or `wrangler.json` file in the project root. An example configuration generated by `npx wrangler init` or `npx create cloudflare` is as follows:
4939

5040
```toml
5141
name = "my-worker"
52-
main = "./src/index.ts" # init w/ TypeScript
42+
main = "./src/index.ts"
5343
compatibility_date = "YYYY-MM-DD"
5444
```
5545

5646
For more detailed information about configuration, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/configuration/).
5747

5848
## Commands
5949

60-
### `wrangler init [name]`
61-
62-
Creates a Worker project. For details on configuration keys and values, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/#init).
50+
### Workers
6351

64-
### `wrangler dev`
52+
#### `wrangler dev`
6553

6654
Start a local development server, with live reloading and devtools.
6755

68-
### `wrangler deploy`
56+
#### `wrangler deploy`
6957

70-
Publish the given script to the worldwide Cloudflare network.
58+
Publish the given script to Cloudflare's global network.
7159

7260
For more commands and options, refer to the [documentation](https://developers.cloudflare.com/workers/wrangler/commands/).
7361

74-
## Pages
62+
### Pages
7563

76-
### `wrangler pages dev [directory] [-- command]`
64+
#### `wrangler pages dev [directory]`
7765

78-
Either serves a static build asset directory, or proxies itself in front of a command.
66+
Serves a static build asset directory.
7967

8068
Builds and runs functions from a `./functions` directory or uses a `_worker.js` file inside the static build asset directory.
8169

8270
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`.
83-
84-
## Documentation
85-
86-
For the latest Wrangler documentation, [click here](https://developers.cloudflare.com/workers/wrangler/).

0 commit comments

Comments
 (0)