{"c8":{"exclude":["dist/**/*.js","dist/**/*.cjs","test/**"]},"_id":"htmlnano@3.6.1","bin":{"htmlnano":"dist/bin.js"},"bugs":{"url":"https://github.com/maltsev/htmlnano/issues"},"dist":{"shasum":"fe77c38cc7572d584f7c951bc09bedf21cd22814","tarball":"http://registry-npm.ywwl.com/htmlnano/download/htmlnano-3.6.1.tgz","fileCount":155,"integrity":"sha512-BYPyIO1bcfSOIGqPH0fOSR+Vs8tBJUcOjnsfrPUkVthSueF1kIrtSE7CvksqKAjqAgPc+fMZ80jaexnfxnGpbw==","signatures":[{"sig":"MEYCIQDa7sQy8xTWiyGD3lL7HIM4xWg01V0TvmLFwtZQy4I1AwIhAJ5ZjnEgtQasdDXstzPTcztf4liqP2WCoYDvvrJxJvyH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDgKkx12xpkoleKlgCGQUvXiWfB69q4t8mi6y0RX6LCQQIgfYv43wUX2NH88CPadQ+pUgV4MDGaOha/zrkqJECFv7g="}],"unpackedSize":535432,"size":134412,"noattachment":false,"key":"/htmlnano/-/htmlnano-3.6.1.tgz"},"main":"./dist/index.js","name":"htmlnano","types":"./dist/index.d.ts","author":{"name":"Kirill Maltsev","email":"maltsevkirill@gmail.com"},"module":"./dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./helpers":{"import":{"types":"./dist/helpers.d.mts","default":"./dist/helpers.mjs"},"require":{"types":"./dist/helpers.d.ts","default":"./dist/helpers.js"}},"./presets/max":{"import":{"types":"./dist/presets/max.d.mts","default":"./dist/presets/max.mjs"},"require":{"types":"./dist/presets/max.d.ts","default":"./dist/presets/max.js"}},"./presets/safe":{"import":{"types":"./dist/presets/safe.d.mts","default":"./dist/presets/safe.mjs"},"require":{"types":"./dist/presets/safe.d.ts","default":"./dist/presets/safe.js"}},"./presets/ampSafe":{"import":{"types":"./dist/presets/ampSafe.d.mts","default":"./dist/presets/ampSafe.mjs"},"require":{"types":"./dist/presets/ampSafe.d.ts","default":"./dist/presets/ampSafe.js"}}},"gitHead":"095f53695ddc327dca8f82b02f649314c495ca89","license":"MIT","scripts":{"lint":"npm run lint:eslint && npm run lint:duplicates && npm run lint:knip","test":"c8 -r text -r html npm run test:mocha","build":"npm run clean && bunchee","clean":"rimraf dist coverage","compile":"npm run build","prepare":"npm run compile","pretest":"npm run lint && npm run compile && npm run test:types","release":"node scripts/release.js","posttest":"c8 check-coverage --lines 85 --branches 75 --per-file","lint:knip":"knip","postbuild":"chmod +x dist/bin.js","test:mocha":"mocha --timeout 5000 --require @swc-node/register --recursive --ignore 'test/typecheck/**/*.ts' --check-leaks --globals addresses 'test/**/*.ts'","test:types":"tsc --noEmit -p tsconfig.typecheck.json","lint:eslint":"eslint --fix .","test:package":"npm run compile && publint && attw --pack .","lint:markdown":"eslint \"**/*.{md,mdx}\"","lint:duplicates":"jscpd","lint:markdown:fix":"npm run lint:markdown -- --fix"},"version":"3.6.1","_npmUser":{"name":"maltsev","email":"maltsevkirill@gmail.com"},"homepage":"https://github.com/maltsev/htmlnano","keywords":["posthtml","posthtml-plugin","html","postproccessor","minifier"],"overrides":{"yargs":"^18.0.0"},"repository":{"url":"git://github.com/maltsev/htmlnano.git","type":"git"},"_npmVersion":"12.0.2","description":"Modular HTML minifier, built on top of the PostHTML","directories":{},"maintainers":[{"name":"scrum","email":"scrum@list.ru"},{"name":"maltsev","email":"maltsevkirill@gmail.com"}],"_nodeVersion":"26.7.0","dependencies":{"entities":"^8.0.0","posthtml":"^0.16.5","commander":"^15.0.0","tinyglobby":"^0.2.17","cosmiconfig":"^10.0.0","@types/relateurl":"^0.2.33"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^12.0.0","knip":"^6.0.2","svgo":"^4.0.0","jscpd":"^5.0.5","mocha":"^12.0.0","uncss":"^0.17.3","eslint":"^10.2.0","expect":"^30.1.1","parse5":"^8.0.1","rimraf":"^6.0.0","srcset":"^5.0.1","terser":"^5.21.0","bunchee":"^7.0.0","cssnano":"^9.0.0","globals":"^17.0.0","postcss":"^8.3.11","publint":"^0.3.21","purgecss":"^8.0.0","relateurl":"^0.2.7","@eslint/js":"^10.0.1","fast-check":"^4.8.0","typescript":"^6.0.2","@types/node":"^26.0.0","@types/mocha":"^10.0.10","posthtml-parser":"^0.12.1","posthtml-render":"^3.0.0","eslint-plugin-yml":"^3.8.1","typescript-eslint":"^8.58.1","@swc-node/register":"^1.10.10","@arethetypeswrong/cli":"^0.18.4","eslint-plugin-import-x":"^4.16.2","@stylistic/eslint-plugin":"^5.3.1","eslint-plugin-markdownlint":"^1.0.0","eslint-config-flat-gitignore":"^2.3.0","eslint-plugin-unused-imports":"^4.4.1"},"peerDependencies":{"svgo":"^4.0.0","uncss":"^0.17.3","srcset":"^5.0.1","terser":"^5.21.0","cssnano":"^7.0.0 || ^8.0.0 || ^9.0.0","postcss":"^8.3.11","purgecss":"^8.0.0","relateurl":"^0.2.7"},"peerDependenciesMeta":{"svgo":{"optional":true},"uncss":{"optional":true},"srcset":{"optional":true},"terser":{"optional":true},"cssnano":{"optional":true},"postcss":{"optional":true},"purgecss":{"optional":true},"relateurl":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/htmlnano_3.6.1_1791718380714_0.37570903434912895"},"readme":"<h1><img src=\"docs/static/logo.png\" alt=\"htmlnano logo\" width=\"90\" align=\"absmiddle\">&nbsp;htmlnano</h1>\n\n[![npm version](https://badge.fury.io/js/htmlnano.svg)](http://badge.fury.io/js/htmlnano)\n![CI](https://github.com/maltsev/htmlnano/actions/workflows/ci.yml/badge.svg)\n\nModular HTML minifier, built on top of the [PostHTML](https://github.com/posthtml/posthtml). Inspired by [cssnano](https://github.com/cssnano/cssnano).\n\n## Documentation\n\n<https://htmlnano.netlify.app>\n\n## Usage\n\n```bash\nnpm install htmlnano\n```\n\n```js\nconst htmlnano = require('htmlnano');\nconst options = {\n    removeEmptyAttributes: false, // Disable the module \"removeEmptyAttributes\"\n    collapseWhitespace: 'conservative' // Pass options to the module \"collapseWhitespace\"\n};\n// posthtml, posthtml-render, and posthtml-parse options\nconst postHtmlOptions = {\n    sync: true, // https://github.com/posthtml/posthtml#usage\n    lowerCaseTags: true, // https://github.com/posthtml/posthtml-parser#options\n    quoteAllAttributes: false, // https://github.com/posthtml/posthtml-render#options\n};\n\nhtmlnano\n    // \"preset\" arg might be skipped (see \"Presets\" section below for more info)\n    // \"postHtmlOptions\" arg might be skipped\n    .process(html, options, preset, postHtmlOptions)\n    .then(function (result) {\n        // result.html is minified\n    })\n    .catch(function (err) {\n        console.error(err);\n    });\n```\n\nAlso, you can use it as CLI tool:\n\n```bash\nnode_modules/.bin/htmlnano --help\n\n# STDIN -> STDOUT\ncat test.html | node_modules/.bin/htmlnano > test.min.html\n\n# Single file\nnode_modules/.bin/htmlnano test.html -o test.min.html\n\n# Multiple files / globs (quote globs so htmlnano expands them itself)\nnode_modules/.bin/htmlnano \"dist/**/*.html\" --output-dir minified\nnode_modules/.bin/htmlnano \"dist/**/*.html\" --in-place\n```\n\nMore usage examples (PostHTML, CLI, Webpack): <https://htmlnano.netlify.app/usage>\n\n## Benchmarks\n\nUpdated: 2026-10-11\n\n[html-minifier-terser]: https://www.npmjs.com/package/html-minifier-terser/v/7.2.0\n[html-minifier-next]: https://www.npmjs.com/package/html-minifier-next/v/8.10.7\n[htmlnano]: https://www.npmjs.com/package/htmlnano/v/3.6.0\n[minify]: https://www.npmjs.com/package/@tdewolff/minify/v/2.24.8\n[minify-html]: https://www.npmjs.com/package/@minify-html/node/v/0.18.1\n[swc-html]: https://www.npmjs.com/package/@swc/html/v/1.16.18\n\n| Website                                                         | Source (KB) | [html-minifier-terser] | [html-minifier-next] |           [htmlnano] | [minify] | [minify-html] |          [swc-html] |\n| --------------------------------------------------------------- | ----------: | ---------------------: | -------------------: | -------------------: | -------: | ------------: | ------------------: |\n| [developer.mozilla.org](https://developer.mozilla.org/en-US/)   |         119 |                  39.1% | **<ins>41.9%</ins>** |                  N/A |    41.2% |         41.1% |               41.6% |\n| [alistapart.com](https://alistapart.com/)                       |          64 |                   6.8% |                11.0% | **<ins>35.6%</ins>** |    10.3% |          8.0% |               11.0% |\n| [css-tricks.com](https://css-tricks.com/)                       |         150 |                    N/A |                14.1% | **<ins>25.2%</ins>** |    12.6% |          9.1% |               13.3% |\n| [en.wikipedia.org](https://en.wikipedia.org/wiki/Main_Page)     |         247 |                   4.7% |                 7.7% |  **<ins>9.8%</ins>** |     6.0% |          6.1% |                6.3% |\n| [html.spec.whatwg.org](https://html.spec.whatwg.org/multipage/) |         151 |                  -3.9% |                 0.3% |                 0.2% |     0.3% |          0.2% | **<ins>1.5%</ins>** |\n| [edri.org](https://edri.org/)                                   |          84 |                   7.4% |                13.0% | **<ins>32.1%</ins>** |    12.1% |          7.9% |               12.6% |\n| [home.cern](https://home.cern/)                                 |         292 |                    N/A |                11.7% | **<ins>24.5%</ins>** |     8.0% |          4.7% |               10.2% |\n| [mastodon.social](https://mastodon.social/explore)              |          50 |                   3.8% | **<ins>13.3%</ins>** | **<ins>13.3%</ins>** |     5.7% |          7.0% |                8.3% |\n| [leanpub.com](https://leanpub.com/)                             |         524 |                   1.2% |                 8.9% |  **<ins>9.5%</ins>** |     5.3% |          1.7% |                5.8% |\n| [stackoverflow.blog](https://stackoverflow.blog/)               |         134 |                   4.0% |                 7.0% |  **<ins>7.1%</ins>** |     4.6% |          4.9% |                5.5% |\n| [weather.com](https://weather.com/)                             |         360 |                   0.5% |                 8.3% |  **<ins>8.6%</ins>** |     6.4% |          0.9% |                6.4% |\n| [eff.org](https://eff.org/)                                     |          54 |                   8.6% | **<ins>15.6%</ins>** |                14.9% |    13.1% |         11.1% |               13.1% |\n| [apple.com](https://apple.com/)                                 |         248 |                   6.1% |                 8.6% |  **<ins>9.1%</ins>** |     7.6% |          6.7% |                7.0% |\n| [w3.org](https://w3.org/)                                       |          50 |                  17.9% | **<ins>23.3%</ins>** |                23.0% |    22.9% |         19.0% |               22.9% |\n| [bbc.co.uk](https://bbc.co.uk/)                                 |         752 |                   0.8% |                 7.1% |  **<ins>7.3%</ins>** |     4.8% |          1.2% |                6.3% |\n| [un.org](https://un.org/en/)                                    |         161 |                  13.5% |                22.4% | **<ins>42.2%</ins>** |    19.1% |         14.3% |               16.7% |\n| [github.com](https://github.com/)                               |         564 |                   1.5% | **<ins>15.2%</ins>** |                  N/A |     5.2% |          4.1% |                4.6% |\n| [faz.net](https://faz.net/aktuell/)                             |        1366 |                   3.9% |                10.6% | **<ins>16.6%</ins>** |     4.3% |          4.3% |                9.4% |\n| [tc39.es](https://tc39.es/ecma262/)                             |        7450 |                   5.7% |  **<ins>8.1%</ins>** |                 7.5% |     6.6% |          6.2% |                7.9% |\n| [lafrenchtech.gouv.fr](https://lafrenchtech.gouv.fr/)           |         184 |                  26.4% |                30.6% | **<ins>68.3%</ins>** |    29.8% |         26.9% |               30.5% |\n| **Avg. minify rate**                                            |             |               **6.7%** |            **12.2%** |            **19.1%** | **9.9%** |      **7.9%** |           **10.7%** |\n\nLatest benchmarks: <https://github.com/maltsev/html-minifiers-benchmark> (updated daily).\n","publish_time":1791718380797,"_cnpm_publish_time":1791718380797,"dist-tags":{"latest":"3.6.1"}}