4.1.2 • Published 2 months ago

fetch-css v4.1.2

Weekly downloads
170
License
BSD-2-Clause
Repository
github
Last release
2 months ago

fetch-css

npm.io npm.io

Extract CSS from websites and browser extensions

Usage

npm i fetch-css
import fetchCss from "fetch-css";

// retrieve CSS of a website
const [{css}] = await fetchCss([{url: "https://example.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 or Array An absolute URL pointing to either a website or directly to a CSS or JS file (to extract inlined CSS strings from)
      • 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
      • strict: boolean Whether to throw an error if fetch fails. Default: false

Returns a Promise that resolves to a sources array with additional css properties present on each source.

Related

  • remap-css - Remap CSS rules based on declaration value

© silverwind, distributed under BSD licence

4.1.2

2 months ago

4.1.0

10 months ago

4.1.1

10 months ago

4.0.12

10 months ago

4.0.13

10 months ago

4.0.9

1 year ago

4.0.10

1 year ago

4.0.11

1 year ago

4.0.8

1 year ago

4.0.5

1 year ago

4.0.4

1 year ago

4.0.7

1 year ago

4.0.6

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.3

1 year ago

4.0.2

1 year ago

3.1.12

3 years ago

3.1.11

3 years ago

3.1.10

3 years ago

3.1.9

3 years ago

3.1.7

3 years ago

3.1.8

3 years ago

3.1.6

3 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago