
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
MIMETIC consistently supports IE9+, Safari 6.2+, Chrome, Firefox, Edge, Opera, etc. MIMETIC does not use any form of browser detection and does not modify element styles.
Alpha release
MIMETIC is a JavaScript viewport engine, that quantifies relative units to the viewport and devicePixelRatio conditionally. Which means text can scale to the viewport's dimensions without breaking the browser’s ability to zoom.
It enables developers to:
Viewport units allow you to scale fonts to viewport dimensions but unfortunately they prevent the browser’s ability to zoom. This is important for accessibility. There are other libraries that can scale text to the viewport/ container but they either break zoom or have impractical cross browser compatibility issues. MIMETIC is able to decipher
There’s a few simple concepts you need to understand to create Scalable Web Design via MIMETIC.
npm i mimetic
or
yarn add mimetic
Because MIMETIC is considered as a crucial part of the document’s styling it is encouraged to either:
or
Execute MIMETIC preferably before all other scripts.
Mimetic();
MIMETIC can simply be used as a zoom detection library. Simply by disabling scale and using the provided onZoom callback arguments:
Mimetic({
scale: false,
onZoom: (a,b,c,d) => console.log(a,b,c,d);
});
MIMETIC has a 2.5kb gzip size and will not exceed a 3.5kb gzip size.
Below is the list of config options passed as an object:
| Property | Value | Description | Default |
|---|---|---|---|
| cutOffWidth | String - CSS units | The minimal width to disable scaling | 0 |
| enableScale | Booolean | Enables scaling of relative units | true |
| loadEvent | String - LoadEvent type | native load event to use before auctioning | "DOMContentLoaded" |
| mobileWidth | String - CSS units | The minimal width to disable scaling for mobile devices | "40em" |
| onResize | ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} | Callback on scale and or zoom | undefined |
| onScale | ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} | Callback on resize only | undefined |
| onZoom | ({viewportWidth, innerWidth, evalDPR, calculatedDPR, normalizedDPR}) => {} | Callback on zoom only | undefined |
| preserveDevicePixelRatio | Boolean | Normalises the device pixel ratio for high ratio devices | false |
| relativeDesignWidth | String - CSS units | The width relative to the font size | "1024px" |
| scaleDelay | Number - Milliseconds | The debounced delay to call on resize | 16 |
MIT (c) 2017 Julien Etienne.
FAQs
Scalable Fonts & Zoom Detection
The npm package mimetic receives a total of 15 weekly downloads. As such, mimetic popularity was classified as not popular.
We found that mimetic demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.