Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 76cfa71

Browse files
committed
Update miniflare package README.md for version 2
1 parent a098748 commit 76cfa71

File tree

2 files changed

+87
-48
lines changed

2 files changed

+87
-48
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ workers in a sandbox implementing Workers' runtime APIs.
1717

1818
---
1919

20-
<!--prettier-ignore-start-->
21-
:::warning
22-
⚠️ This branch is for the next major version of Miniflare, which is
23-
under development.
24-
:::
25-
<!--prettier-ignore-end-->
20+
> ⚠️ This branch is for the next major version of Miniflare, which is under
21+
> development.
2622
2723
Miniflare 2 has been completely redesigned from version 1 with 3 primary design
2824
goals:

packages/miniflare/README.md

Lines changed: 85 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,29 @@
1313
It's an alternative to `wrangler dev`, written in TypeScript, that runs your
1414
workers in a sandbox implementing Workers' runtime APIs.
1515

16-
**See <https://miniflare.dev> for more detailed documentation.**
16+
**See <https://v2.miniflare.dev> for more detailed documentation.**
17+
18+
---
19+
20+
> ⚠️ This branch is for the next major version of Miniflare, which is under
21+
> development.
22+
23+
Miniflare 2 has been completely redesigned from version 1 with 3 primary design
24+
goals:
25+
26+
1. 📚 **Modular:** Miniflare 2 splits Workers components (KV, Durable Objects,
27+
etc.) into **separate packages** (`@miniflare/kv`,
28+
`@miniflare/durable-objects`, etc.) that you can import separately for
29+
testing.
30+
2.**Lightweight:** Miniflare 1 included
31+
[122 third-party packages](http://npm.anvaka.com/#/view/2d/miniflare) with a
32+
total install size of `88.3MB`. Miniflare 2 reduces this to **24 packages and
33+
`11.5MB`** 🤯. This can probably be reduced further too.
34+
3.**Correct:** Miniflare 2 more accurately replicates the quirks and thrown
35+
errors of the real Workers runtime, so you'll know before you deploy if
36+
things are going to break.
37+
38+
---
1739

1840
## Features
1941

@@ -39,8 +61,8 @@ workers in a sandbox implementing Workers' runtime APIs.
3961
Miniflare is installed using npm:
4062

4163
```shell
42-
$ npm install -g miniflare # either globally..
43-
$ npm install -D miniflare # ...or as a dev dependency
64+
$ npm install -g miniflare@next # either globally..
65+
$ npm install -D miniflare@next # ...or as a dev dependency
4466
```
4567

4668
## Using the CLI
@@ -77,43 +99,64 @@ console.log(await res.text()); // Hello Miniflare!
7799
```
78100
Usage: miniflare [script] [options]
79101
80-
Options:
81-
-h, --help Show help [boolean]
82-
-v, --version Show version number [boolean]
83-
-H, --host HTTP server host to listen on (all by default)[string]
84-
-p, --port HTTP server port (8787 by default) [number]
85-
-d, --debug Log debug messages [boolean]
86-
-c, --wrangler-config Path to wrangler.toml [string]
87-
--wrangler-env Environment in wrangler.toml to use [string]
88-
--package Path to package.json [string]
89-
-m, --modules Enable modules [boolean]
90-
--modules-rule Modules import rule (TYPE=GLOB) [array]
91-
--build-command Command to build project [string]
92-
--build-base-path Working directory for build command [string]
93-
--build-watch-path Directory to watch for rebuilding on changes [string]
94-
-w, --watch Watch files for changes [boolean]
95-
-u, --upstream URL of upstream origin [string]
96-
-t, --cron Cron pattern to trigger scheduled events with [array]
97-
-k, --kv KV namespace to bind [array]
98-
--kv-persist Path to persist KV data to (omit path for default)
99-
--cache-persist Path to persist cached data to (omit path for default)
100-
--disable-cache Disable caching with default/named caches [boolean]
101-
-s, --site Path to serve Workers Site files from [string]
102-
--site-include Glob pattern of site files to serve [array]
103-
--site-exclude Glob pattern of site files not to serve [array]
104-
-o, --do Durable Object to bind (NAME=CLASS) [array]
105-
--do-persist Path to persist Durable Object data to (omit path for
106-
default)
107-
-e, --env Path to .env file [string]
108-
-b, --binding Bind variable/secret (KEY=VALUE) [array]
109-
--wasm WASM module to bind (NAME=PATH) [array]
110-
--https Enable self-signed HTTPS
111-
--https-key Path to PEM SSL key [string]
112-
--https-cert Path to PEM SSL cert chain [string]
113-
--https-ca Path to SSL trusted CA certs [string]
114-
--https-pfx Path to PFX/PKCS12 SSL key/cert chain [string]
115-
--https-passphrase Passphrase to decrypt SSL files [string]
116-
--disable-updater Disable update checker [boolean]
102+
Core Options:
103+
-h, --help Show help [boolean]
104+
-v, --version Show version number [boolean]
105+
-c, --wrangler-config Path to wrangler.toml [string]
106+
--wrangler-env Environment in wrangler.toml to use [string]
107+
--package Path to package.json [string]
108+
-m, --modules Enable modules [boolean]
109+
--modules-rule Modules import rule [array:TYPE=GLOB]
110+
--compat-date Opt into backwards-incompatible changes from [string]
111+
--compat-flag Control specific backwards-incompatible changes [array]
112+
-u, --upstream URL of upstream origin [string]
113+
-w, --watch Watch files for changes [boolean]
114+
-d, --debug Enable debug logging [boolean]
115+
-V, --verbose Enable verbose logging [boolean]
116+
--(no-)update-check Enable update checker (enabled by default) [boolean]
117+
118+
HTTP Options:
119+
-H, --host Host for HTTP(S) server to listen on [string]
120+
-p, --port Port for HTTP(S) server to listen on [number]
121+
--https Enable self-signed HTTPS (with optional cert path) [boolean/string]
122+
--https-key Path to PEM SSL key [string]
123+
--https-cert Path to PEM SSL cert chain [string]
124+
--https-ca Path to SSL trusted CA certs [string]
125+
--https-pfx Path to PFX/PKCS12 SSL key/cert chain [string]
126+
--https-passphrase Passphrase to decrypt SSL files [string]
127+
--(no-)cf-fetch Path for cached Request cf object from Cloudflare [boolean/string]
128+
--live-reload Reload HTML pages whenever worker is reloaded [boolean]
129+
130+
Scheduler Options:
131+
-t, --cron CRON expression for triggering scheduled events [array]
132+
133+
Build Options:
134+
-B, --build-command Command to build project [string]
135+
--build-base-path Working directory for build command [string]
136+
--build-watch-path Directory to watch for rebuilding on changes [array]
137+
138+
KV Options:
139+
-k, --kv KV namespace to bind [array]
140+
--kv-persist Persist KV data (to optional path) [boolean/string]
141+
142+
Durable Objects Options:
143+
-o, --do Durable Object to bind [array:NAME=CLASS]
144+
--do-persist Persist Durable Object data (to optional path) [boolean/string]
145+
146+
Cache Options:
147+
--(no-)cache Enable default/named caches (enabled by default) [boolean]
148+
--cache-persist Persist cached data (to optional path) [boolean/string]
149+
150+
Sites Options:
151+
-s, --site Path to serve Workers Site files from [string]
152+
--site-include Glob pattern of site files to serve [array]
153+
--site-exclude Glob pattern of site files not to serve [array]
154+
155+
Bindings Options:
156+
-e, --env Path to .env file [string]
157+
-b, --binding Binds variable/secret to environment [array:KEY=VALUE]
158+
--global Binds variable/secret to global scope [array:KEY=VALUE]
159+
--wasm WASM module to bind [array:NAME=PATH]
117160
```
118161

119162
## Acknowledgements
@@ -127,5 +170,5 @@ for inspiration.
127170
Durable Object's transactions are implemented using Optimistic Concurrency
128171
Control (OCC) as described in
129172
["On optimistic methods for concurrency control." ACM Transactions on Database Systems](https://dl.acm.org/doi/10.1145/319566.319567).
130-
Thanks to [Alistair O'Brien](https://github.com/johnyob) for helping me
131-
understand this.
173+
Thanks to [Alistair O'Brien](https://github.com/johnyob) for helping the
174+
Miniflare author understand this.

0 commit comments

Comments
 (0)