{"id":32161482,"url":"https://github.com/contivero/hasmin","last_synced_at":"2025-10-21T13:55:02.803Z","repository":{"id":15886099,"uuid":"78932439","full_name":"contivero/hasmin","owner":"contivero","description":"Hasmin - A Haskell CSS Minifier","archived":false,"fork":false,"pushed_at":"2024-01-13T03:21:31.000Z","size":375,"stargazers_count":57,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-21T13:54:51.098Z","etag":null,"topics":["compression","css","css-minifier","gzip","haskell","minifier"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contivero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-01-14T09:55:07.000Z","updated_at":"2023-09-13T20:49:51.000Z","dependencies_parsed_at":"2024-02-26T01:03:29.837Z","dependency_job_id":"bc46e21f-4031-48c8-a502-288c65da9a35","html_url":"https://github.com/contivero/hasmin","commit_stats":{"total_commits":146,"total_committers":5,"mean_commits":29.2,"dds":0.04109589041095896,"last_synced_commit":"bff2d0c4441132eb0b83bba17c350d955247b3c2"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/contivero/hasmin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contivero%2Fhasmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contivero%2Fhasmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contivero%2Fhasmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contivero%2Fhasmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contivero","download_url":"https://codeload.github.com/contivero/hasmin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contivero%2Fhasmin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280272337,"owners_count":26302260,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"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":["compression","css","css-minifier","gzip","haskell","minifier"],"created_at":"2025-10-21T13:55:01.279Z","updated_at":"2025-10-21T13:55:02.787Z","avatar_url":"https://github.com/contivero.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hasmin - A Haskell CSS Minifier\n====\n[![Build Status](https://travis-ci.org/contivero/hasmin.svg?branch=master)](https://travis-ci.org/contivero/hasmin)\n[![Hackage](https://img.shields.io/hackage/v/hasmin.svg?style=flat)](http://hackage.haskell.org/package/hasmin)\n[![Hackage-Deps](https://img.shields.io/hackage-deps/v/hasmin.svg?style=flat)](http://packdeps.haskellers.com/specific?package=hasmin)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nAside from the usual techniques (e.g. whitespace removal, color minification,\netc.), the idea was to explore new possibilities, by implementing things\nother minifiers weren't doing, or they were, but not taking full advantage of.\n\nAlso, the minifier implements some techniques that do nothing for minified\nsizes, but attempt to improve post-compression sizes (at least when using\nDEFLATE, i.e. gzip).\n\nFor a list of techniques, see [the wiki](https://github.com/contivero/hasmin/wiki).\nTo use it as a library, see\n[below](https://github.com/contivero/hasmin#library).\n\n## Building \u0026 Installing\n### Stack\nThe easiest and prefered way is using\n[stack](https://docs.haskellstack.org/en/stable/README/). To directly install, use the following one-liner:\n```sh\ngit clone git@github.com:contivero/hasmin.git \u0026\u0026 cd hasmin \u0026\u0026 stack install\n```\nStack installs inside `~/.local/bin` by default. If you'd rather just try hasmin\nout, replace `install` by `build`, and then use `stack exec hasmin` from inside\nthe hasmin directory (keep in mind it has a slight additional delay at the\nbeginning when run this way).\n\n### Cabal\nAlternatively, you can use [cabal](https://www.haskell.org/cabal/):\n```sh\n$ cd path/to/hasmin/repo\n$ cabal update                      # Make sure to have the latest package list\n$ cabal sandbox init                # Initialise a sandbox\n$ cabal install --only-dependencies # Install dependencies into the sandbox\n$ cabal build                       # Build hasmin inside the sandbox\n```\n\n## Minifier Usage\nHasmin expects a path to the CSS file, and outputs the minified result to\nstdout. Say you have a `sheet.css` and want to minify it, and save it as\n`sheet.min.css`. Then, run:\n```sh\n$ hasmin sheet.css \u003e sheet.min.css\n```\n\nEvery technique is enabled by default, except for:\n 1. Escaped character conversions (e.g. converting `\\2714` into `✔`, enabled\n    with `--convert-escaped-characters`).\n 2. Dimension minifications (e.g. converting `12px` to `9pt`, enabled with\n    `--dimension-min`, or just `-d`).\n 3. Lexicographical sorting of declarations (enabled with\n    `--sort-declarations`).\n\nThe first two are disabled mainly because they are—on average, not\nalways—detrimental for DEFLATE compression. As for declaration sorting, whether\nit benefits or hurts compression rates is very stylesheet-dependent, and the\ncurrent implementation is quite naive, hence unsafe.\n\nWhen something needs to be disabled, use the appropriate flag. Not every\ntechnique can be toggled, but if there is any one in particular that you need to\nand can't, open an issue about it.\n\nNote: there is a problem in Windows when using the\n`--convert-escaped-characters` flag to enable the conversion of escaped\ncharacters. A workaround is changing the code page, which can be done by running\n`chcp 65001` in the terminal (whether cmd, or cygwin).\n\n## Library\nThe preferable way to use Hasmin as a library is to `import Hasmin`; a usage\nexample can be seen in the [module's documentation](https://hackage.haskell.org/package/hasmin/docs/Hasmin.html).\nThat is currently the only module that is sure to abide by\n[PVP](https://pvp.haskell.org/). Most other exposed modules are so because tests\nneed it, and thus definitions there may be changed anytime. In case something\ninternal is needed though, feel free to open an issue about it.\n\n## Zopfli Integration\nHasmin uses bindings to Google's\n[Zopfli library](https://en.wikipedia.org/wiki/Zopfli), allowing the\npossibility to compress the result.\n\nSince the output is a gzip file, it can be used for the web. It tipically\nproduces files 3~8% smaller than zlib, at the cost of being around 80 times\nslower, so it is only a good idea if you don't need compression on the fly.\n\n\nZopfli is [released under the Apache License, Version 2.0](https://github.com/google/zopfli/blob/master/COPYING).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontivero%2Fhasmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontivero%2Fhasmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontivero%2Fhasmin/lists"}