{"id":22222049,"url":"https://github.com/fabiospampinato/critically","last_synced_at":"2025-07-20T11:33:41.839Z","repository":{"id":66053390,"uuid":"185450507","full_name":"fabiospampinato/critically","owner":"fabiospampinato","description":"Tiny performant library for extracting the critical CSS.","archived":false,"fork":false,"pushed_at":"2024-04-04T22:25:21.000Z","size":22,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-25T13:05:06.915Z","etag":null,"topics":["critical","css","isomorphic","performance","tiny"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiospampinato.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},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2019-05-07T17:41:08.000Z","updated_at":"2024-06-26T20:41:21.000Z","dependencies_parsed_at":"2024-04-04T23:28:10.856Z","dependency_job_id":"01ecee32-4086-4e09-9c82-9d192a509d97","html_url":"https://github.com/fabiospampinato/critically","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"35b4a047e5effd238d53695bceb37075799529ee"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/fabiospampinato/critically","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcritically","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcritically/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcritically/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcritically/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/critically/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcritically/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266117854,"owners_count":23879128,"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":["critical","css","isomorphic","performance","tiny"],"created_at":"2024-12-02T23:16:41.509Z","updated_at":"2025-07-20T11:33:41.810Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"# Critically\n\nTiny performant library for extracting the critical CSS.\n\nCompared to [`critical`](https://github.com/addyosmani/critical) this library:\n\n- Is so much smaller, at about 2kb in size. `critical` instead needs to download a whole browser.\n- It works in the browser too, which is useful if you need to store the previous state of the app or a skeleton of it.\n- Will output slightly larger strings, as only simple minification techniques are performed.\n- Is much faster.\n\n## Install\n\n```sh\nnpm install --save critically\n```\n\n## API\n\nThis library provides the following interface:\n\n```ts\ntype Options = {\n  document?: Document, // The document from which to extract the critical CSS\n  html?: string, // The HTML string from which to extract the critical CSS\n  minify?: boolean, // Whether to enable minification or not\n  transform?: ( doc: Document ) =\u003e Document | void // A function that will be run before extracting the critical CSS, useful for removing unneeded elements from the document\n};\n\ntype Result = {\n  clone: Document, // The cloned document object\n  html: string, // Full HTML with the critical CSS embedded in it\n  css: string // Only the critical CSS\n};\n\nasync function critically ( options: Options ): Promise\u003cResult\u003e;\n```\n\nYou need to provide either an HTML string or a document object. The document will be cloned, so you can modify it safely via the `transform` function.\n\n## Usage\n\n```ts\nimport critically from 'critically';\n\nconst {clone, html, css} = await critically ({ document });\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fcritically","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fcritically","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fcritically/lists"}