fetch-css

1.0.0 • Public • Published

fetch-css

Extract CSS from websites and browser extensions

Usage

npm i fetch-css
const fetchCss = require("fetch-css");

# retrieve CSS of a website
const [{css}] = await fetchCss([{url: "https://google.com"}]);

# extract CSS from a Chrome extension
const [{css}] = await fetchCss([{crx: "hlepfoohegkhhmjieoechaddaejaokhf"}]);

API

fetchCss(sources)

  • sources: Array Array of source objects
    • source: Object
      • url: string An absolute URL pointing to either a website or directly to a CSS file
      • fetchOpts: Object Options passed to fetch
      • crx: string A Chrome extension id
      • contentScriptsOnly: boolean Whether to pull only content scripts from a extension. Default: false

Returns a promise that resolves to a sources object with additional css properties present.

© silverwind, distributed under BSD licence

/fetch-css/

    Package Sidebar

    Install

    npm i fetch-css@1.0.0

    Version

    1.0.0

    License

    BSD-2-Clause

    Unpacked Size

    7.29 kB

    Total Files

    3

    Last publish

    Collaborators

    • silverwind