Skip to content
EASEL.js

Install EASEL.js

EASEL.js is published as the @xsyetopz/easel package. Use the package manager already used by your application:

Terminal window
bun add @xsyetopz/easel
Terminal window
npm install @xsyetopz/easel

The package is also available through JSR:

Terminal window
bunx jsr add @xsyetopz/easel

Import the library as an ES module. In a browser build, provide a Canvas2D element to the renderer or let it create one for you.

import * as EASEL from "@xsyetopz/easel";
const canvas = document.querySelector("canvas");
if (!(canvas instanceof HTMLCanvasElement)) {
throw new Error("A canvas element is required.");
}
const renderer = new EASEL.Renderer({
canvas,
width: 640,
height: 360,
});

The renderer writes ImageData to Canvas2D. A browser that does not provide a 2D context cannot display a scene, but the scene graph and API modules remain usable for non-rendering work.