Socket
Book a DemoInstallSign in
Socket

domgeom

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domgeom

DOM Geometry interfaces shim for Node.js

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

domgeom

Note: this is a work in progress.

A polyfill for the DOM Geometry Interfaces Level 1 for JavaScript runtimes that don’t include them.

Installation

domgeom is available as an npm package:

npm install --save domgeom

Usage

import { 
	DOMMatrix, 
	DOMMatrixReadOnly, 
	DOMPoint, 
	DOMPointReadOnly, 
	DOMRect,
	DOMRectReadOnly, 
	DOMQuad 
} from 'domgeom';

globalThis.DOMMatrix = DOMMatrix;
globalThis.DOMMatrixReadOnly = DOMMatrixReadOnly;
globalThis.DOMPoint = DOMPoint;
globalThis.DOMPointReadOnly = DOMPointReadOnly;
globalThis.DOMRect = DOMRect;
globalThis.DOMRectReadOnly = DOMRectReadOnly;
globalThis.DOMQuad = DOMQuad;

Differences from the spec

  • DOMMatrixReadOnly.prototype.toString() throws an Error instead of an "InvalidStateError" DOMException.
  • The read-only interfaces are not actually read only (it just seemed tedious to implement).

Also note that due to numerical errors there may be slight differences in the matrix values compared to browser environments. In tests, rounding the values before comparisons is recommended.

Further reading

FAQs

Package last updated on 02 Jul 2025

Did you know?

Socket

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.

Install

Related posts