{"id":15686018,"url":"https://github.com/silverwind/fetch-css","last_synced_at":"2025-05-07T17:30:07.142Z","repository":{"id":57234545,"uuid":"242388237","full_name":"silverwind/fetch-css","owner":"silverwind","description":"Extract CSS from websites and browser extensions","archived":false,"fork":false,"pushed_at":"2024-03-05T02:01:24.000Z","size":604,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T00:38:19.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-22T18:08:21.000Z","updated_at":"2023-10-19T00:56:16.000Z","dependencies_parsed_at":"2024-03-05T03:24:22.885Z","dependency_job_id":"dc24be6e-e37a-4b3c-a267-f8db9fbf6185","html_url":"https://github.com/silverwind/fetch-css","commit_stats":{"total_commits":89,"total_committers":1,"mean_commits":89.0,"dds":0.0,"last_synced_commit":"fb58541abbf9e55deea697023776b2e3e21816f1"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ffetch-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ffetch-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ffetch-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Ffetch-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverwind","download_url":"https://codeload.github.com/silverwind/fetch-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252926423,"owners_count":21826310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:34:45.748Z","updated_at":"2025-05-07T17:30:07.079Z","avatar_url":"https://github.com/silverwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fetch-css\n[![](https://img.shields.io/npm/v/fetch-css.svg?style=flat)](https://www.npmjs.org/package/fetch-css) [![](https://img.shields.io/npm/dm/fetch-css.svg)](https://www.npmjs.org/package/fetch-css)\n\u003e Extract CSS from websites and browser extensions\n\n## Usage\n\n```console\nnpm i fetch-css\n```\n```js\nimport fetchCss from \"fetch-css\";\n\n// retrieve CSS of a website\nconst [{css}] = await fetchCss([{url: \"https://example.com\"}]);\n\n// extract CSS from a Chrome extension\nconst [{css}] = await fetchCss([{crx: \"hlepfoohegkhhmjieoechaddaejaokhf\"}]);\n```\n\n## API\n### `fetchCss(sources)`\n\n- `sources`: *Array* Array of source objects\n  - `source`: *Object*\n    - `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)\n    - `fetchOpts`: *Object* Options passed to [fetch](https://github.com/npm/make-fetch-happen#fetch)\n    - `crx`: *string* A Chrome extension id\n    - `contentScriptsOnly`: *boolean* Whether to pull only content scripts from a extension. Default: `false`\n    - `strict`: *boolean* Whether to throw an error if fetch fails. Default: `false`\n\nReturns a `Promise` that resolves to a `sources` array with additional `css` properties present on each source.\n\n## Related\n\n- [remap-css](https://github.com/silverwind/remap-css) - Remap CSS rules based on declaration value\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Ffetch-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverwind%2Ffetch-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Ffetch-css/lists"}