{"_id":"hast-util-minify-whitespace","_rev":"2-1ed5fb958a9fc180d0027ff1d98353b2","name":"hast-util-minify-whitespace","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"hast-util-minify-whitespace","version":"1.0.0","keywords":["hast","hast-util","html","minify","unist","util","utility","whitespace"],"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","_id":"hast-util-minify-whitespace@1.0.0","maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://github.com/rehypejs/rehype-minify/tree/main#readme","bugs":{"url":"https://github.com/rehypejs/rehype-minify/issues"},"xo":{"rules":{"capitalized-comments":"off","unicorn/prefer-string-replace-all":"off"},"prettier":true},"dist":{"shasum":"e3170d521beea2a4e7fc4b35987c8aa6c49a0925","tarball":"https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.0.tgz","fileCount":17,"integrity":"sha512-gD1m4YJSIk62ij32TlhFNqsC3dOQvpA4QAhyZOZFAT4u8LfEfB6N+F0V9oXQGBWXoqrs0h9wQRKa8RCeo8j61g==","signatures":[{"sig":"MEQCIFLqFNhBsycVyBz4AKR1vcpa/F5P4QxiuSA8v1qyHdrZAiBDdlsY7WO6pLuRdNpmdAnKU9oBdIVYVKVkc33YjNiAIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20965},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"671df5f164ced01c4d5ce191af911631aee5d571","scripts":{},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"repository":{"url":"git+https://github.com/rehypejs/rehype-minify.git#main","type":"git"},"_npmVersion":"10.8.3","description":"hast utility to get the plain-text value of a node","directories":{},"sideEffects":false,"_nodeVersion":"22.7.0","dependencies":{"@types/hast":"^3.0.0","unist-util-is":"^6.0.0","hast-util-embedded":"^3.0.0","hast-util-is-element":"^3.0.0","hast-util-whitespace":"^3.0.0"},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/hast-util-minify-whitespace_1.0.0_1726584606543_0.5562491747109852","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"hast-util-minify-whitespace","version":"1.0.1","description":"hast utility to get the plain-text value of a node","license":"MIT","keywords":["hast","hast-util","html","minify","unist","util","utility","whitespace"],"repository":{"type":"git","url":"git+https://github.com/rehypejs/rehype-minify.git#main"},"bugs":{"url":"https://github.com/rehypejs/rehype-minify/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"sideEffects":false,"type":"module","exports":"./index.js","dependencies":{"@types/hast":"^3.0.0","hast-util-embedded":"^3.0.0","hast-util-is-element":"^3.0.0","hast-util-whitespace":"^3.0.0","unist-util-is":"^6.0.0"},"scripts":{},"typeCoverage":{"atLeast":100,"detail":true,"ignoreCatch":true,"strict":true},"xo":{"prettier":true,"rules":{"capitalized-comments":"off","unicorn/prefer-string-replace-all":"off"}},"_id":"hast-util-minify-whitespace@1.0.1","gitHead":"79383ba769010ff52c547c57850d2dd3ecb815a9","types":"./index.d.ts","homepage":"https://github.com/rehypejs/rehype-minify/tree/main#readme","_nodeVersion":"22.7.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==","shasum":"7588fd1a53f48f1d30406b81959dffc3650daf55","tarball":"https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.1.tgz","fileCount":18,"unpackedSize":22035,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgQkEYxRvB2Zm83a99IC49xzxrA7bkF/LDougwKpuOIAiBJw8s4I4Of5LUzIaid1YZpE7c2cEpmSXFZ7SHZpQP2Ug=="}]},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-minify-whitespace_1.0.1_1727437746024_0.8174711193898219"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-17T14:50:06.542Z","modified":"2024-09-27T11:49:06.506Z","1.0.0":"2024-09-17T14:50:06.685Z","1.0.1":"2024-09-27T11:49:06.228Z"},"bugs":{"url":"https://github.com/rehypejs/rehype-minify/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"license":"MIT","homepage":"https://github.com/rehypejs/rehype-minify/tree/main#readme","keywords":["hast","hast-util","html","minify","unist","util","utility","whitespace"],"repository":{"type":"git","url":"git+https://github.com/rehypejs/rehype-minify.git#main"},"description":"hast utility to get the plain-text value of a node","contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"readme":"<!--This file is generated-->\n\n# hast-util-minify-whitespace\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][funding-sponsors-badge]][funding]\n[![Backers][funding-backers-badge]][funding]\n[![Chat][chat-badge]][chat]\n\n[`hast`][hast] utility to minify whitespace between elements.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`Options`](#options)\n  * [`minifywhitespace(tree[, options])`](#minifywhitespacetree-options)\n* [Syntax](#syntax)\n* [Syntax tree](#syntax-tree)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a utility that can minify the whitespace between elements.\n\n## When should I use this?\n\nYou can use this package when you want to improve the size of HTML fragments.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install hast-util-minify-whitespace\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport {minifyWhitespace} from 'https://esm.sh/hast-util-minify-whitespace@1'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import {minifyWhitespace} from 'https://esm.sh/hast-util-minify-whitespace@1?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {h} from 'hastscript'\nimport {minifyWhitespace} from 'hast-util-minify-whitespace'\n\nconst tree = h('p', [\n  '  ',\n  h('strong', 'foo'),\n  '  ',\n  h('em', 'bar'),\n  '  ',\n  h('meta', {itemProp: true}),\n  '  '\n])\n\nminifyWhitespace(tree)\n\nconsole.log(tree)\n//=> h('p', [h('strong', 'foo'), ' ', h('em', 'bar'), h('meta', {itemProp: true})])\n```\n\n## API\n\nThis package exports the identifier\n`minifyWhitespace`.\nThere is no default export.\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `newlines` (`boolean`, default: `false`)\n  — collapse whitespace containing newlines to `'\\n'` instead of `' '`\n  (default: `false`);\n  the default is to collapse to a single space\n\n###### Returns\n\nNothing (`undefined`).\n\n### `minifywhitespace(tree[, options])`\n\nMinify whitespace.\n\n###### Parameters\n\n* `tree` (`Node`) — tree\n* `options` (`Options`, optional) — configuration\n\n###### Returns\n\nNothing (`undefined`).\n\n## Syntax\n\nHTML is parsed according to WHATWG HTML (the living standard), which is also\nfollowed by all browsers.\n\n## Syntax tree\n\nThe syntax tree used is [hast][].\n\n## Types\n\nThis package is fully typed with [TypeScript][].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`hast-util-minify-whitespace@^1`,\ncompatible with Node.js 16.\n\n## Security\n\nAs **rehype** works on HTML and improper use of HTML can open you up to a\n[cross-site scripting (XSS)][xss] attack, use of rehype can also be unsafe.\nUse [`rehype-sanitize`][rehype-sanitize] to make the tree safe.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n[author]: https://wooorm.com\n\n[build]: https://github.com/rehypejs/rehype-minify/actions\n\n[build-badge]: https://github.com/rehypejs/rehype-minify/workflows/main/badge.svg\n\n[chat]: https://github.com/rehypejs/rehype/discussions\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[coc]: https://github.com/rehypejs/.github/blob/main/code-of-conduct.md\n\n[contributing]: https://github.com/rehypejs/.github/blob/main/contributing.md\n\n[coverage]: https://codecov.io/github/rehypejs/rehype-minify\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-minify.svg\n\n[downloads]: https://www.npmjs.com/package/hast-util-minify-whitespace\n\n[downloads-badge]: https://img.shields.io/npm/dm/hast-util-minify-whitespace.svg\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esm-sh]: https://esm.sh\n\n[funding]: https://opencollective.com/unified\n\n[funding-backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[funding-sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[hast]: https://github.com/syntax-tree/hast\n\n[health]: https://github.com/rehypejs/.github\n\n[license]: https://github.com/rehypejs/rehype-minify/blob/main/license\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[rehype-sanitize]: https://github.com/rehypejs/rehype-sanitize\n\n[size]: https://bundlejs.com/?q=hast-util-minify-whitespace\n\n[size-badge]: https://img.shields.io/bundlejs/size/hast-util-minify-whitespace\n\n[support]: https://github.com/rehypejs/.github/blob/main/support.md\n\n[typescript]: https://www.typescriptlang.org\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n","readmeFilename":"readme.md"}