{"id":22903972,"url":"https://github.com/json2d/css-extractor","last_synced_at":"2025-04-01T07:56:53.373Z","repository":{"id":95070011,"uuid":"85967687","full_name":"json2d/css-extractor","owner":"json2d","description":":gem: extracts class names and ids from CSS","archived":false,"fork":false,"pushed_at":"2017-03-23T20:29:46.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T22:07:00.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/json2d.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,"publiccode":null,"codemeta":null}},"created_at":"2017-03-23T15:44:45.000Z","updated_at":"2019-02-16T16:39:07.000Z","dependencies_parsed_at":"2023-03-13T16:54:10.017Z","dependency_job_id":null,"html_url":"https://github.com/json2d/css-extractor","commit_stats":null,"previous_names":["bitstrider/css-extractor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fcss-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fcss-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fcss-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fcss-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json2d","download_url":"https://codeload.github.com/json2d/css-extractor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246604619,"owners_count":20804100,"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-12-14T02:39:39.166Z","updated_at":"2025-04-01T07:56:53.348Z","avatar_url":"https://github.com/json2d.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-extractor\n:gem: extracts class names and ids from CSS\n\n### Installing\n```\n$ npm install css-extractor\n```\n\n### Basic Usage\n```javascript\nvar extractor = require('css-extractor');\n\nvar css = \"#id, .class { color:#000 }\";\n\nextractor.extract(css);\n// =\u003e ['#id','.class']\n```\n`extract` will return an array of all unique class names and ids\n\n### Approach\nThis module was designed to be lightweight, with no dependencies, using `RegExp` patterns to trim the input CSS content and capture the class names and ids.\n\n### Testing\nTests are performed using the `tap` testing framework.  To run:\n```\n$ npm install\n$ npm test\n```\n\nThe main focus of the test cases is to ensure compatibility with common and uncommon syntactic features and liberties available in CSS, including:\n\n* `@media` queries\n* attribute selectors: `#id[href='#id-like']`\n* arbitrary and non-mandatory spacing\n* comment blocks\n\nFor more on such cases, check out the `.css` files in `test\\fixtures`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fcss-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson2d%2Fcss-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fcss-extractor/lists"}