{"id":17002462,"url":"https://github.com/thednp/dommatrix","last_synced_at":"2026-01-17T21:35:19.053Z","repository":{"id":57215009,"uuid":"294521637","full_name":"thednp/dommatrix","owner":"thednp","description":"A Typescript sourced DOMMatrix shim for Node.js apps and legacy browsers.","archived":false,"fork":false,"pushed_at":"2026-01-17T08:17:06.000Z","size":1037,"stargazers_count":23,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T11:39:21.235Z","etag":null,"topics":["3d-matrix","cssmatrix","dommatrix","dommatrix-shim","javascript","legacy-browsers","nodejs","polyfill","shim","typescript"],"latest_commit_sha":null,"homepage":"https://thednp.github.io/dommatrix","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thednp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["thednp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2020-09-10T21:01:27.000Z","updated_at":"2026-01-17T08:17:09.000Z","dependencies_parsed_at":"2024-06-18T16:53:15.361Z","dependency_job_id":"b9fd239b-44e2-48b9-b152-302ba6546455","html_url":"https://github.com/thednp/dommatrix","commit_stats":{"total_commits":162,"total_committers":2,"mean_commits":81.0,"dds":0.3580246913580247,"last_synced_commit":"cadc1a3f90596a67b7576c3d2c3ea05e2991e170"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/thednp/dommatrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fdommatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fdommatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fdommatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fdommatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thednp","download_url":"https://codeload.github.com/thednp/dommatrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thednp%2Fdommatrix/sbom","scorecard":{"id":878372,"data":{"date":"2025-08-11","repo":{"name":"github.com/thednp/dommatrix","commit":"d5deddd456f10589327af35b0082705abedf5917"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:34","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:35","Warn: no topLevel permission defined: .github/workflows/badges.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/badges.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/badges.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/badges.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/badges.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/thednp/dommatrix/codeql.yml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T06:59:14.557Z","repository_id":57215009,"created_at":"2025-08-24T06:59:14.558Z","updated_at":"2025-08-24T06:59:14.558Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28518628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-matrix","cssmatrix","dommatrix","dommatrix-shim","javascript","legacy-browsers","nodejs","polyfill","shim","typescript"],"created_at":"2024-10-14T04:28:06.137Z","updated_at":"2026-01-17T21:35:19.044Z","avatar_url":"https://github.com/thednp.png","language":"TypeScript","funding_links":["https://github.com/sponsors/thednp"],"categories":[],"sub_categories":[],"readme":"## DOMMatrix\r\n[![Coverage Status](https://coveralls.io/repos/github/thednp/dommatrix/badge.svg)](https://coveralls.io/github/thednp/dommatrix) \r\n[![NPM Version](https://img.shields.io/npm/v/@thednp/dommatrix.svg)](https://www.npmjs.com/package/@thednp/dommatrix)\r\n[![NPM Downloads](https://img.shields.io/npm/dm/@thednp/dommatrix.svg)](http://npm-stat.com/charts.html?@thednp/dommatrix)\r\n[![ci](https://github.com/thednp/dommatrix/actions/workflows/ci.yml/badge.svg)](https://github.com/thednp/dommatrix/actions/workflows/ci.yml)\r\n[![jsDeliver](https://data.jsdelivr.com/v1/package/npm/@thednp/dommatrix/badge)](https://www.jsdelivr.com/package/npm/@thednp/dommatrix)\r\n[![typescript version](https://img.shields.io/badge/typescript-5.9.3-brightgreen)](https://www.typescriptlang.org/)\r\n[![vitest version](https://img.shields.io/badge/vitest-4.0.17-brightgreen)](https://vitest.dev/)\r\n[![vite version](https://img.shields.io/badge/vite-7.3.1-brightgreen)](https://vitejs.dev/)\r\n\r\nA TypeScript sourced [DOMMatrix](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrix) shim for **Node.js** apps and legacy browsers.\r\n\r\nThe constructor is close to the **DOMMatrix Interface** in many respects, but tries to keep a sense of simplicity. In that note, we haven't implemented [DOMMatrixReadOnly](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly) methods like `flipX()` or `inverse()` or aliases for the main methods like the old `rotate3d`.\r\n\r\nDOMMatrix shim is meant to be a light pocket tool for many things like [svg-path-commander](http://thednp.github.io/svg-path-commander), for a complete polyfill you might want to also consider more  [geometry-interfaces](https://github.com/trusktr/geometry-interfaces)\r\nand [geometry-polyfill](https://github.com/jarek-foksa/geometry-polyfill).\r\n\r\nThis library implements a full transform string parsing via the static method `.fromString()`, which produce results inline with the DOMMatrix Interface as well as a very [elegant method](https://github.com/jsidea/jsidea/blob/2b4486c131d5cca2334293936fa13454b34fcdef/ts/jsidea/geom/Matrix3D.ts#L788) to determine `is2D`. Before moving to the [technical details](#More-info) of this script, have a look at the demo.\r\n\r\n\r\n## Demo\r\nSee DOMMatrix shim in action, [click me](https://thednp.github.io/dommatrix) and start transforming.\r\n\r\n\r\n## Installation\r\n```\r\nnpm install @thednp/dommatrix\r\n# pnpm/bun/deno add @thednp/dommatrix\r\n```\r\nDownload the latest version and copy the `dist/dommatrix.js` file to your project assets folder, then load the file in your front-end:\r\n```html\r\n\u003cscript src=\"./assets/js/dommatrix.js\"\u003e\r\n```\r\n\r\nAlternativelly you can load from CDN:\r\n```html\r\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@thednp/dommatrix/dist/dommatrix.js\"\u003e\r\n```\r\n\r\n## Usage\r\nIn your regular day to day usage, you will find yourself writing something like this:\r\n```js\r\nimport CSSMatrix from '@thednp/dommatrix';\r\n\r\n// init\r\nconst myMatrix = new CSSMatrix('matrix(1,0.25,-0.25,1,0,0)');\r\n\r\n// apply methods\r\nmyMatrix.translate(15);\r\nmyMatrix.rotate(15);\r\n\r\n// apply to styling to target\r\nelement.style.transform = myMatrix.toString();\r\n```\r\n\u003e **Tip** in NodeJS you can import the default as whatever the name you want, best do:\r\n```ts\r\nimport DOMMatrix from '@thednp/dommatrix';\r\n```\r\nFor the complete JavaScript API, check the [JavaScript API](https://github.com/thednp/DOMMatrix/wiki/JavaScript-API) section in our wiki.\r\n\r\n## WIKI\r\nFor more indepth guides, head over to the [wiki pages](https://github.com/thednp/DOMMatrix/wiki) for developer guidelines.\r\n\r\n## More Info\r\nIn contrast with the [original source](https://github.com/arian/CSSMatrix/) there have been a series of changes to the prototype for consistency, performance as well as requirements to better accomodate the **DOMMatrix** interface:\r\n\r\n* **changed** how the constructor determines if the matrix is 2D, based on a [more accurate method](https://github.com/jsidea/jsidea/blob/2b4486c131d5cca2334293936fa13454b34fcdef/ts/jsidea/geom/Matrix3D.ts#L788) which is actually checking the designated values of the 3D space; in contrast, the old *CSSMatrix* constructor sets `afine` property at initialization only and based on the number of arguments or the type of the input CSS transform syntax; \r\n* **fixed** the `translate()`, `scale()` and `rotate()` instance methods to work with one axis transformation, also inline with **DOMMatrix**;\r\n* **changed** `toString()` instance method to utilize the new method `toArray()` described below;\r\n* **changed** `setMatrixValue()` instance method to do all the heavy duty work with parameters;\r\n* **added** `is2D` (*getter* and *setter*) property;\r\n* **added** `isIdentity` (*getter* and *setter*) property;\r\n* **added** `skew()` public method to work in line with native DOMMatrix;\r\n* **added** `Skew()` static method to work with the above `skew()` instance method;\r\n* **added** `fromMatrix` static method, not present in the constructor prototype;\r\n* **added** `fromString` static method, not present in the constructor prototype;\r\n* **added** `fromArray()` static method, not present in the constructor prototype, should also process *Float32Array* / *Float64Array* via `Array.from()`;\r\n* **added** `toFloat64Array()` and `toFloat32Array()` instance methods, the updated `toString()` method makes use of them alongside `toArray`;\r\n* **added** `toArray()` instance method, normalizes values and is used by the `toString()` instance method;\r\n* **added** `toJSON()` instance method will generate a standard *Object* which includes `{a,b,c,d,e,f}` and `{m11,m12,m13,..m44}` properties and excludes `is2D` \u0026 `isIdentity` properties;\r\n* **added** `transformPoint()` instance method which works like the original.\r\n* **added** `isCompatibleArray()` static method to check if an array is a compatible array of 6/16 numbers.\r\n* **added** `isCompatibleObject()` static method to checks if an object is compatible with CSSMatrix, usually another CSSMatrix / DOMMatrix instance or the result of these instances toJSON() method call.\r\n* *removed* `afine` property, it's a very old *WebKitCSSMatrix* defined property;\r\n* *removed* `inverse()` instance method, will be re-added later for other implementations (probably going to be accompanied by `determinant()`, `transpose()` and others);\r\n* *removed* `transform` instance method, not present in the native **DOMMatrix** prototype;\r\n* *removed* `setIdentity()` instance method due to code rework for enabling better TypeScript definitions;\r\n* *removed* `toFullString()` instance method, probably something also from *WebKitCSSMatrix*;\r\n* *removed* `feedFromArray` static method, not present in the constructor prototype, `fromArray()` will cover that;\r\n* *not supported* `fromFloat64Array()` and `fromFloat32Array()` static methods are not supported, our `fromArray()` should handle them just as well;\r\n* *not supported* `flipX()` or `flipY()` instance methods of the *DOMMatrixReadOnly* prototype are not supported,\r\n* *not supported* `scaleNonUniformSelf()` or `rotate3d()` with `{x, y, z}` transform origin parameters are not implemented.\r\n\r\n\r\n## Thanks\r\n* Joe Pea for his [geometry-interfaces](https://github.com/trusktr/geometry-interfaces)\r\n* Jarek Foksa for his [geometry-polyfill](https://github.com/jarek-foksa/geometry-polyfill)\r\n* Arian Stolwijk for his [CSSMatrix](https://github.com/arian/CSSMatrix/)\r\n\r\n## License\r\nDOMMatrix shim is [MIT Licensed](https://github.com/thednp/DOMMatrix/blob/master/LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthednp%2Fdommatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthednp%2Fdommatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthednp%2Fdommatrix/lists"}