{"id":29567151,"url":"https://github.com/alexstevovich/struct-css","last_synced_at":"2026-02-19T15:35:52.562Z","repository":{"id":288949361,"uuid":"948794675","full_name":"alexstevovich/struct-css","owner":"alexstevovich","description":"[Node.js] Enables two-way conversion of raw CSS into a structured representation.","archived":false,"fork":false,"pushed_at":"2025-03-15T01:19:38.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T14:18:33.690Z","etag":null,"topics":["css","nodejs","struct","structured-data","webstandards"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexstevovich.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,"zenodo":null}},"created_at":"2025-03-15T01:18:54.000Z","updated_at":"2025-03-15T02:06:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"0044ff6c-91ad-4c3c-9b60-da0f2ad2184a","html_url":"https://github.com/alexstevovich/struct-css","commit_stats":null,"previous_names":["alexstevovich/struct-css"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexstevovich/struct-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexstevovich%2Fstruct-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexstevovich%2Fstruct-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexstevovich%2Fstruct-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexstevovich%2Fstruct-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexstevovich","download_url":"https://codeload.github.com/alexstevovich/struct-css/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexstevovich%2Fstruct-css/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29620144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T13:04:20.082Z","status":"ssl_error","status_checked_at":"2026-02-19T13:03:33.775Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["css","nodejs","struct","structured-data","webstandards"],"created_at":"2025-07-18T23:10:35.953Z","updated_at":"2026-02-19T15:35:52.557Z","avatar_url":"https://github.com/alexstevovich.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# struct-css\n\n\u003e **Archetype:** Node.js package\n\n**struct-css** enables two-way conversion of raw CSS into a structured JavaScript object representation and vice versa.\n\n## Install\n\n```js\nnpm install struct-css\n```\n\n## Usage\n\n### structure\n\nConverts raw CSS to a structured JavaScript representation.\n\n```js\nimport { struct } from 'struct-css';\n\nconst cssString = 'div { color: blue; font-size: 16px; }';\nconst structure = struct(cssString);\n\nconsole.log(structure);\nconsole.log(structure.rules[0].declarations[0].property); // Output: 'color'\n```\n\n**Output** _(Prettyfied for example)_:\n\n```js\n{\n\t\"rules\":\n\t[\n\t\t{\n\t\t\"selectors\": [\"div\"],\n\t\t\"declarations\":\n\t\t\t[\n\t\t\t\t{ \"property\": \"color\", \"value\": \"blue\" },\n\t\t\t\t{ \"property\": \"font-size\", \"value\": \"16px\" }\n\t\t\t],\n\t\t\"rules\": []\n\t\t}\n\t]\n}\n```\n\n### css\n\nConverts a structured JavaScript representation back to raw CSS.\n\n```js\nimport { css } from 'struct-css';\n\nconst structure = {\n    rules: [\n        {\n            selectors: ['div'],\n            declarations: [\n                { property: 'color', value: 'blue' },\n                { property: 'font-size', value: '16px' },\n            ],\n            rules: [],\n        },\n    ],\n    declarations: [],\n};\n\nconst cssString = css(structure);\nconsole.log(cssString);\n```\n\n**Output** Raw CSS string _Prettyfied for example_\n\n```css\ndiv {\n    color: blue;\n    font-size: 16px;\n}\n```\n\n## License\n\nApache-2.0 License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstevovich%2Fstruct-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexstevovich%2Fstruct-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstevovich%2Fstruct-css/lists"}