
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
@csstools/media-query-list-parser
Advanced tools
Implemented from : https://www.w3.org/TR/mediaqueries-5/
Add Media Query List Parser to your project:
npm install @csstools/media-query-list-parser @csstools/css-parser-algorithms @csstools/css-tokenizer --save-dev
Media Query List Parser depends on our CSS tokenizer and parser algorithms.
It must be used together with @csstools/css-tokenizer and @csstools/css-parser-algorithms.
import { parse } from '@csstools/media-query-list-parser';
export function parseCustomMedia() {
const mediaQueryList = parse('screen and (min-width: 300px), (50px < height < 30vw)');
mediaQueryList.forEach((mediaQuery) => {
mediaQuery.walk((entry, index) => {
// Index of the current Node in `parent`.
console.log(index);
// Type of `parent`.
console.log(entry.parent.type);
// Type of `node`
{
// Sometimes nodes can be arrays.
if (Array.isArray(entry.node)) {
entry.node.forEach((item) => {
console.log(item.type);
});
}
if ('type' in entry.node) {
console.log(entry.node.type);
}
}
// stringified version of the current node.
console.log(entry.node.toString());
// Return `false` to stop the walker.
return false;
});
});
}
postcss-media-query-parser is a PostCSS plugin that parses media queries in CSS. It provides similar functionality to @csstools/media-query-list-parser but is designed to work within the PostCSS ecosystem, making it a good choice if you are already using PostCSS for other CSS transformations.
css-mediaquery is a utility for parsing and matching CSS media queries. It offers similar parsing capabilities but also includes features for evaluating media queries against a given set of conditions, which can be useful for server-side rendering or testing environments.
FAQs
Parse CSS media query lists.
The npm package @csstools/media-query-list-parser receives a total of 6,786,127 weekly downloads. As such, @csstools/media-query-list-parser popularity was classified as popular.
We found that @csstools/media-query-list-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.