{"id":16324065,"url":"https://github.com/lionad-morotar/mini-snapshot","last_synced_at":"2026-03-18T18:59:40.423Z","repository":{"id":113293499,"uuid":"314199002","full_name":"Lionad-Morotar/mini-snapshot","owner":"Lionad-Morotar","description":"快照压缩","archived":false,"fork":false,"pushed_at":"2023-12-15T17:50:34.000Z","size":608,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-14T15:16:57.765Z","etag":null,"topics":["css-tree-shaking","html-minify"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/Lionad-Morotar.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":"2020-11-19T09:31:12.000Z","updated_at":"2020-11-20T09:46:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"2061bdb0-d3dc-4794-81d7-02f6e066e0f9","html_url":"https://github.com/Lionad-Morotar/mini-snapshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lionad-Morotar/mini-snapshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lionad-Morotar%2Fmini-snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lionad-Morotar%2Fmini-snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lionad-Morotar%2Fmini-snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lionad-Morotar%2Fmini-snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lionad-Morotar","download_url":"https://codeload.github.com/Lionad-Morotar/mini-snapshot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lionad-Morotar%2Fmini-snapshot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28731888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["css-tree-shaking","html-minify"],"created_at":"2024-10-10T22:56:29.510Z","updated_at":"2026-01-24T16:44:18.033Z","avatar_url":"https://github.com/Lionad-Morotar.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 快照压缩\n\n使用前请确保已经安装了 [NodeJS](https://nodejs.org/en/) 环境。\n\n## 如何使用\n\n参考 index.test.js 文件\n\n```js\nconst minifier = require('./index.js')\n\nconst minifiedhtml = await minifier(`\u003cbody\u003e\u003c/body\u003e`)\n```\n\n## 如何测试\n\n* npm install\n* npm run test\n\n## 测试结果\n\n```\n# v1.2.0\n# 新增：CSS 非语义化压缩\n[001] dailiyun.html reduced to:  41.47%\n[002] dailiyun_wap.html reduced to:  49.89%\n[003] snapshot_raw.html reduced to:  40.96%\n[004] snapshot_with_singlefile_plugin.html reduced to:  85.51%\n\n# v1.1.0\n# 新增：HTML 非语义化压缩\n[001] dailiyun.html reduced to:  44.27%\n[002] dailiyun_wap.html reduced to:  52.79%\n[003] snapshot_raw.html reduced to:  44.09%\n[004] snapshot_with_singlefile_plugin.html reduced to:  90.73%\n\n# v1.0.0 \n# 新增：CSS 摇树优化\n[001] reduced to:  47.34%\n[002] reduced to:  59.84%\n[003] reduced to:  51.81% # 压缩直接用浏览器保存的 HTML 文件，效果约为 50%\n[004] reduced to:  92.66% # 压缩使用 SingleFile 插件保存的 HTML 文件，效果不大\n```\n\n从测试文件来看，压缩效果在 45% 上下浮动。\n\n## 依赖说明\n\n- [Cheerio](https://cheerio.js.org/)，用来解析 HTML，处理 DOM 节点\n- [PostCSS](https://postcss.org/api/#postcss)，用来解析 CSS，处理 CSS 节点\n- [minHTML](https://github.com/kangax/html-minifier)，非语义化压缩 HTML\n- [cssnano](https://cssnano.co/docs/)，非语义化压缩 CSS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionad-morotar%2Fmini-snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flionad-morotar%2Fmini-snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flionad-morotar%2Fmini-snapshot/lists"}