A single threaded implementation of Web Locks API. Works across runtimes (Browser, Deno, Node).
This package is 🚧 work-in-progress so the API is not fully implemented:
-
locks.request()
- "exclusive" locks
- "shared" locks
-
options.signal
-
options.ifAvailable
-
options.steal
-
locks.query()
import { locks } from "https://jspm.dev/simple-web-locks/mod.js"
// or
import { locks } from "https://deno.land/x/simple_web_locks/mod.js"
import { locks } from "https://deno.land/x/simple_web_locks/mod.ts"
import { locks } from "simple-web-locks"
For the documentation please refer to the MDN article.
This project uses Deno and TypeScript as a development toolchain.
deno test
deno run benchmarks.ts
yarn build