better-beacon
v0.1.1
Published
A better version of `navigator.sendBeacon`, that doesn't break when you try to queue too many events!<sup><a href="#whaaa">1</a></sup>
Downloads
5
Readme
Better (send)Beacon
A better version of navigator.sendBeacon
, that doesn't break when you try to queue too many events!1
Installation:
bun add better-beacon
Usage:
import BetterBeacon from "better-beacon";
let bbeacon = new BetterBeacon({
autoTransformJSON: true,
});
// Works just like `navigator.sendBeacon`!
bbeacon.send("/path", "true");
// Automatically converts objects to Blobs under the hood
bbeacon.send("/path", { data: true });
Context:
Contributing:
build
bun run build
test
bun test
Tools:
- Typescript
- SWC
- Bun