{"id":16331243,"url":"https://github.com/steelydylan/extract-classnames","last_synced_at":"2026-04-21T05:31:16.872Z","repository":{"id":69412070,"uuid":"134073501","full_name":"steelydylan/extract-classnames","owner":"steelydylan","description":"extract css classnames from html","archived":false,"fork":false,"pushed_at":"2018-05-20T03:22:03.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-04T10:33:38.012Z","etag":null,"topics":["cli","node","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steelydylan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2018-05-19T15:20:05.000Z","updated_at":"2018-05-24T05:42:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"78bed98f-e15f-4762-a5c0-bd0fc6610467","html_url":"https://github.com/steelydylan/extract-classnames","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/steelydylan/extract-classnames","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Fextract-classnames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Fextract-classnames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Fextract-classnames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Fextract-classnames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steelydylan","download_url":"https://codeload.github.com/steelydylan/extract-classnames/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Fextract-classnames/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32078721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T02:38:07.213Z","status":"ssl_error","status_checked_at":"2026-04-21T02:38:06.559Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","node","npm"],"created_at":"2024-10-10T23:26:11.865Z","updated_at":"2026-04-21T05:31:16.832Z","avatar_url":"https://github.com/steelydylan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# extract-classnames\n\nNode command line tool where you can extract css from html\n\ninput \n\n```htm\n\u003cfigure class=\"photo\"\u003e\n    \u003cimg class=\"photo__img\" src=\"me.jpg\"\u003e\n    \u003cfigcaption class=\"photo__caption\"\u003e\n        \u003cblockquote class=\"photo__quote\"\u003e\n        Look at me!\n        \u003c/blockquote\u003e\n    \u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\noutput\n\n```css\n.photo {\n\n}\n.photo__img {\n\n}\n.photo__caption {\n\n}\n.photo__quote {\n\n}\n```\n\n## Usage\n\n```sh\nnpm install extract-classnames\nnpx excn --src ./test/index.html --dest ./test/index.css\n```\n\nglobal install\n\n```sh\nnpm install extract-classnames -g\nexcn --src ./test/index.html --dest ./test/index.css\n```\n\nyou can also execute the same function with the command `extract-classnames`\n\n```sh\nextract-classnames --src ./test/index.html --dest ./test/index.css\n```\n\n## API\n\nextract\n```js\nconst excn = require('extract-classnames');\nconst result = excn.extract(html);\n```\n\nextractByFile\n```js\nconst excn = require('extract-classnames');\nexcn.extractByFile('/path/to/filename').then((css) =\u003e {\n  console.log(css);\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteelydylan%2Fextract-classnames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteelydylan%2Fextract-classnames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteelydylan%2Fextract-classnames/lists"}