From faeb97d951d321a1e7c5f1f121e957c70891e04b Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Tue, 19 Nov 2024 10:55:12 +0100 Subject: [PATCH] docs: Update README to include Cloudflare Workers compatibility --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index fe53285..352da09 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,20 @@ yarn add xxhash-wasm The global `xxhash` will be available. +### Cloudflare Workers + +If you are using [Cloudflare +Workers](https://developers.cloudflare.com/workers/) (workerd) you can use the installed +npm package as is. The `xxhash-wasm` package is compatible with Cloudflare Workers. + +```javascript +import xxhash from "xxhash-wasm"; +``` + +Importing it will pick the correct file base on the [conditional +import](https://developers.cloudflare.com/workers/wrangler/bundling/#conditional-exports) +from the package.json. + ## Usage The WebAssembly is contained in the JavaScript bundle, so you don't need to