Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@prettier/parse-srcset
Advanced tools
A spec-conformant JavaScript parser for the HTML5 srcset attribute
This repository is a fork of https://github.com/albell/parse-srcset for Prettier.
A javascript parser for the HTML5 srcset attribute, based on the WHATWG reference algorithm. It has an extensive test suite based on the W3C srcset conformance checker.
yarn add @prettier/parse-srcset
import parseSrcset from "@prettier/parse-srcset";
parseSrcset('elva-fairy-320w.jpg, elva-fairy-480w.jpg 1.5x, elva-fairy-640w.jpg 2x');
/*
[
{ source: { value: 'elva-fairy-320w.jpg', startOffset: 0 } },
{
source: { value: 'elva-fairy-480w.jpg', startOffset: 21 },
density: { value: 1.5 }
},
{
source: { value: 'elva-fairy-640w.jpg', startOffset: 47 },
density: { value: 2 }
}
]
*/
FAQs
A spec-conformant JavaScript parser for the HTML5 srcset attribute
The npm package @prettier/parse-srcset receives a total of 3,510 weekly downloads. As such, @prettier/parse-srcset popularity was classified as popular.
We found that @prettier/parse-srcset demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.