
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@happy-dom/node-canvas-adapter
Advanced tools
Pluggable canvas adapter for happy-dom using node-canvas.

Pluggable canvas adapter for Happy DOM using node-canvas.
npm install canvas @happy-dom/node-canvas-adapter
You will find the documentation in the Happy DOM Wiki under Node Canvas Adapter.
import { Window } from 'happy-dom';
import { CanvasAdapter } from '@happy-dom/node-canvas-adapter';
const window = new Window({
settings: {
canvasAdapter: new CanvasAdapter(),
// Optionally, enable image file loading (e.g. for <img> elements)
enableImageFileLoading: true
}
});
const canvas = window.document.createElement('canvas');
const context = canvas.getContext('2d');
canvas.width = 200;
canvas.height = 200;
// Now you can use canvas context
context.fillStyle = 'red';
context.fillRect(0, 0, 100, 100);
// Get data URL
const dataUrl = canvas.toDataURL();
// Output the data URL
console.log(dataUrl);
Documentation | Getting Started | Setup as Test Environment | GitHub
FAQs
Pluggable canvas adapter for happy-dom using node-canvas.
We found that @happy-dom/node-canvas-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.