Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@thi.ng/adapt-dpi
Advanced tools
This project is part of the @thi.ng/umbrella monorepo.
HDPI canvas adapter / styling utility.
Attempts to determine display pixel density via
window.devicePixelRatio
(default 1.0) and resizes canvas accordingly.
I.e. If DPR != 1.0, attaches explicit width
and height
CSS
properties to force canvas to given pixel size, and resizes canvas pixel
buffer itself based on DPR (e.g. 2x size).
STABLE - used in production
yarn add @thi.ng/adapt-dpi
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/adapt-dpi?module" crossorigin></script>
// UMD
<script src="https://unpkg.com/@thi.ng/adapt-dpi/lib/index.umd.js" crossorigin></script>
Package sizes (gzipped, pre-treeshake): ESM: 146 bytes / CJS: 193 bytes / UMD: 311 bytes
None
Several demos in this repo's /examples directory are using this package.
A selection:
Screenshot | Description | Live demo | Source |
---|---|---|---|
Entity Component System w/ 100k 3D particles | Demo | Source | |
WebGL cube maps with async texture loading | Demo | Source | |
WebGL instancing, animated grid | Demo | Source | |
WebGL MSDF text rendering & particle system | Demo | Source |
import { adaptDPI } from "@thi.ng/adapt-dpi";
const canvas = document.createElement("canvas");
adaptDPI(canvas, 640, 480);
Karsten Schmidt
© 2015 - 2020 Karsten Schmidt // Apache Software License 2.0
FAQs
HDPI canvas adapter / styling utility
The npm package @thi.ng/adapt-dpi receives a total of 8 weekly downloads. As such, @thi.ng/adapt-dpi popularity was classified as not popular.
We found that @thi.ng/adapt-dpi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.