{"id":21540942,"url":"https://github.com/reshape/minify","last_synced_at":"2025-04-10T04:11:05.879Z","repository":{"id":65489176,"uuid":"66111778","full_name":"reshape/minify","owner":"reshape","description":"a reshape plugin to minify html output","archived":false,"fork":false,"pushed_at":"2019-02-05T12:45:23.000Z","size":487,"stargazers_count":5,"open_issues_count":15,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:26:40.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reshape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-19T20:56:02.000Z","updated_at":"2018-09-04T22:54:59.000Z","dependencies_parsed_at":"2023-01-25T23:46:39.503Z","dependency_job_id":null,"html_url":"https://github.com/reshape/minify","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fminify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fminify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fminify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fminify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reshape","download_url":"https://codeload.github.com/reshape/minify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"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-11-24T05:00:35.952Z","updated_at":"2025-04-10T04:11:05.860Z","avatar_url":"https://github.com/reshape.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reshape-minify\n\n[![npm](https://img.shields.io/npm/v/reshape-minify.svg?style=flat-square)](https://npmjs.com/package/reshape-minify)\n[![tests](https://img.shields.io/travis/reshape/minify.svg?style=flat-square)](https://travis-ci.org/reshape/minify?branch=master)\n[![dependencies](https://img.shields.io/david/reshape/minify.svg?style=flat-square)](https://david-dm.org/reshape/minify)\n[![coverage](https://img.shields.io/coveralls/reshape/minify.svg?style=flat-square)](https://coveralls.io/r/reshape/minify?branch=master)\n\nA reshape plugin to minify html\n\n\u003e **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.\n\n### Installation\n\n`npm install reshape-minify -S`\n\n\u003e **Note:** This project is compatible with node v6+ only\n\n### Usage\n\nAdd it as a plugin to reshape:\n\n```js\nconst reshape = require('reshape')\nconst minify = require('reshape-minify')\n\nreshape({ plugins: minify(/* options */) })\n  .process(someHtml)\n  .then((res) =\u003e {\n    console.log(res.output(/* locals */))\n  })\n```\n\n#### Options\n\nOptions are passed in an object, all are optional.\n\n| Name | Description | Default |\n| ---- | ----------- | ------- |\n| **collapseWhitespace** | Removes all extra whitespace | `true` |\n| **conservativeCollapse** | Instead of fully removing excess whitespace, collapses down to a single space | `false` |\n| **aggressiveCollapse** | More aggressive whitespace removal, trims all whitespace from beginning and ends of any text | `false` |\n| **removeComments** | Removes all comments from the html | `true` |\n| **minifyCss** | Minifies any CSS in `style` tags | `true` |\n| **minifyJs** | Minifies any JS in `script` tags | `true` |\n| **minifySvg** | Minifies any inline svg | `true` |\n| **minifyJson** | Minifies any json in `script` tags with `*/json` as the type | `true` |\n\n#### To-Do List\n\n- [unquote attributes](https://github.com/kangax/html-minifier/blob/gh-pages/src/htmlminifier.js#L106)\n- [remove trailing zeros on viewport meta](https://github.com/kangax/html-minifier/blob/gh-pages/src/htmlminifier.js#L301)\n- [remove optional parent tags](https://github.com/kangax/html-minifier/blob/gh-pages/src/htmlminifier.js#L369)\n- [minify urls](https://github.com/stevenvachon/relateurl)\n\n### License \u0026 Contributing\n\n- Details on the license [can be found here](LICENSE.md)\n- Details on running tests and contributing [can be found here](contributing.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fminify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freshape%2Fminify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fminify/lists"}