{"id":42417766,"url":"https://github.com/gafreax/csscrunch","last_synced_at":"2026-01-28T02:07:25.143Z","repository":{"id":200583460,"uuid":"704268424","full_name":"gafreax/csscrunch","owner":"gafreax","description":"Simple and fast css parser and optimizer","archived":false,"fork":false,"pushed_at":"2025-12-13T17:55:59.000Z","size":7943,"stargazers_count":7,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T09:05:50.051Z","etag":null,"topics":["css","hacktoberfest","opensource","opensource-saturday-turin"],"latest_commit_sha":null,"homepage":"https://gafreax.github.io/csscrunch/","language":"CSS","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/gafreax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-12T22:53:35.000Z","updated_at":"2025-12-13T17:02:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fcc26a6-aa65-4484-8aa5-d4949bbad193","html_url":"https://github.com/gafreax/csscrunch","commit_stats":null,"previous_names":["gafreax/cssparse","gafreax/csscrunch"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/gafreax/csscrunch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gafreax%2Fcsscrunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gafreax%2Fcsscrunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gafreax%2Fcsscrunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gafreax%2Fcsscrunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gafreax","download_url":"https://codeload.github.com/gafreax/csscrunch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gafreax%2Fcsscrunch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28833521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"online","status_checked_at":"2026-01-28T02:00:06.943Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","hacktoberfest","opensource","opensource-saturday-turin"],"created_at":"2026-01-28T02:07:24.443Z","updated_at":"2026-01-28T02:07:25.138Z","avatar_url":"https://github.com/gafreax.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSS Crunch\n\nThis package provides a powerful and efficient TypeScript library for optimizing CSS strings. It enables developers to easily compress css JavaScript projects.\n\nThe great focus is on keeping a great compatibility across all kind of render engine especially on the various Outlook.\n\n## Features\n* **Group rules:** Group same rules with one selector.\n* **Compress:** Compress the size by removing not necessary char.\n* **Merge selector:** Merge same selector into only one.\n* **Media Query:** Move all media queries at the bottom.\n\n\n## Installation\n\n```bash\nnpm install @gafreax/csscrunch\n```\n\n## Usage\n\n```typescript\n// ESM\nimport csscrunch from '@gafreax/csscrunch'\nconst { default: compile } = csscrunch\n\nconst cssString = '.example { color: red; font-size: 16px; }';\nconst parsedCSS = compile(cssString);\n\n```\n\n```typescript\n// CommonJS\nconst csscrunch = require('@gafreax/csscrunch')\nconst { default: compile } = csscrunch\n\nconst cssString = '.example { color: red; font-size: 16px; }';\nconst parsedCSS = compile(cssString);\n\n```\n\n## Optimization\nTo enable the optimization pass a `Optimizations` object (file: `src/lib/optimization.d.ts`)  to the instance:\n\n```typescript\ninterface Optimizations {\n  paddingShortHand?: boolean\n  marginShortHand?: boolean\n  removeZeroUnits?: boolean\n}\n```\n\n\n\n## CLI Usage\n\n**Quickly clean up your Css:**\n\nTo optimize your CSS file, simply run the following command in your terminal:\n\n```bash\n$ npm start -- compile input.css optimized.css\n```\n\nOr via npx\n\n```bash\n$ npx @gafreax/csscrunch compile input.css optimized.css\n```\n\nOr via global install\n```bash\n$ npm install -g @gafreaxa/csscrunch\n$ csscrunch compile input.css optimized.css\n```\n\nYou can also use the flags:\n`--optimize-short-hand` to optimize padding and margin short hand\n`--optimize-margin` to optimize margin short hand\n`--optimize-padding` to optimize padding short hand\n`--remove-zero-units` to remove zero units\n`--optimize-all` to enable all optimizations\nExample:\n\n```bash\n$ npx @gafreax/csscrunch compile --optimize-all input.css optimized.css\n```\n\n## Benchmark\n\nThis project includes two types of benchmarks.\n\n### Vitest Benchmarks\n\nTo run the standard suite of benchmarks, use the following command:\n\n```bash\npnpm run test:bench\n```\n\n### Performance Comparison vs. clean-css\n\nA dedicated script is available to compare the performance of `csscrunch` against `clean-css`. To run it, use the following command:\n\n```bash\nts-node benchmark/comparison.ts\n```\n\n## Contribution\n\nWe welcome contributions to this open-source project. If you encounter issues or have suggestions for improvement, please feel free to create GitHub issues or submit pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgafreax%2Fcsscrunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgafreax%2Fcsscrunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgafreax%2Fcsscrunch/lists"}