npm.io
0.4.2 • Published 2 months ago

@cf-wasm/satori

Licence
MPL-2.0
Version
0.4.2
Deps
1
Size
286 kB
Vulns
1
Weekly
0
Stars
299

@cf-wasm/satori

Enlightened library to convert HTML and CSS to SVG.

Powered by satori.

Installation

npm install @cf-wasm/satori       # npm
yarn add @cf-wasm/satori          # yarn
pnpm add @cf-wasm/satori          # pnpm

Usage

Because package.json includes conditional exports for node, workerd, and edge-light, you can usually import directly from @cf-wasm/satori and let the runtime choose the correct entrypoint:

import { satori } from "@cf-wasm/satori";

If you want to be explicit, import from a submodule instead:

  • Cloudflare Workers / Pages (Wrangler):

    import { satori } from "@cf-wasm/satori/workerd";
  • Next.js Edge Runtime:

    import { satori } from "@cf-wasm/satori/edge-light";
  • Node.js (inline):

    import { satori } from "@cf-wasm/satori/node";

Documentation

Read official documentation at satori.

Keywords