
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
extract-css-core
Advanced tools
Extract all CSS from a given url, both server side and client side rendered.
Extract all CSS from a given url, both server side and client side rendered.
Existing packages like
get-css
look at a server-generated piece of HTML and get all the <link>
and <style>
tags from it. This works fine for 100% server rendered pages, and pages with
CSS-in-JS styling.
This module uses an instance of Chromium to render a page. This has the benefit
that most of the styles can be rendered, even when generated by JavaScript. The
Puppeteer CSSCoverage API
is the power behind finding most of the CSS. Additionally, the
document.styleSheets
API is used to get CSS-inJS styling.
npm install extract-css-core
# or
yarn add extract-css-core
const extractCss = require('extract-css-core')
const css = await extractCss('http://www.projectwallace.com')
Extract CSS from a page. Returns a Promise that contains the CSS as a single String.
Type: Object
Default: null
Type: String
Default: networkidle2
Can be any value as provided by the Puppeteer docs.
FAQs
Extract all CSS from a given url, both server side and client side rendered.
We found that extract-css-core 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.