{"name":"mdast-util-compact","version":"4.1.1","description":"mdast utility to make a tree compact","license":"MIT","keywords":["unist","mdast","mdast-util","util","utility","tree","compact","node"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-util-compact.git"},"bugs":{"url":"https://github.com/syntax-tree/mdast-util-compact/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","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"@types/mdast":"^3.0.0","unist-util-visit":"^4.0.0"},"devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","unist-builder":"^3.0.0","xo":"^0.53.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"283291addd13a3d796ae5c3bc2e01150614816f1","homepage":"https://github.com/syntax-tree/mdast-util-compact#readme","_id":"mdast-util-compact@4.1.1","_nodeVersion":"19.3.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-h/UFPIkf4ZlJw50k9UC+CkY+/urhFHZB25GXGh0f+kbqSulzZMSEGWeFjAe2jEQsFu9bSjf0s/TdZXsjvtmxIQ==","shasum":"b2d99402b41f368509c9324437f18c9b8c867644","tarball":"http://registry-npm.ywwl.com/mdast-util-compact/download/mdast-util-compact-4.1.1.tgz","fileCount":7,"unpackedSize":9462,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6no2pTw3PhCHym8nIoHVJF/21UGI7zeDjJQ4b7AnC2wIgWNYPA0REG2PnwAAnUHMYmjH3975+jO70zRKSQYHqkHc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0QTfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqODw/9HHC8t/BNmguzxXgLjFjgchh0+V4KRFqz3rchy866W26tfo3Q\r\nSswFhca3CtjxaoSb939j7MwQZCM0RfdcFxQLbh4aZpBzrWQZQSNwbJPR0F6Q\r\nKpINxuZ+ECDJ3DLuh+BC1beYPN0mIkiv/BoQTv0XTKY45QKyIaB/sfqbhgp3\r\n4NrerzJN2BIyuQmhaPNZiRGKPXPcrknlftyu6aAC7IvUypGaZRs1O+pVqL4Y\r\nFNqIzPj4ImTf2A9ysZZh2sEq1uRV9GeXmk0aaHbeci1MJjXbRpsOMWDoSkG/\r\nM8TiL6jjNjH9G8tBUn//ja2heSsIyuE+w1QPHdOWxR/bftlfKkyiWRyGYqGb\r\nKbL6c53NLwwuiet19hbJtiiHoMi6Dngq+i/eBwftWJAMp9PXuxcIWcuBMi3M\r\nWqEd5SuypUOLMfML9DPjaRf3ag4QrNGEzJVKel4Rz6S4qklCyH/49LOLqNOo\r\nm8v5VLFPIv1aIghB3lSp6YqnAYSxPeiq3FIqP+waY3hZSFSzLL6qE34Amdx4\r\nx+gL74oMAvFIkl5MRTdH9TRv64UPMDTC3DN6Xi7ZiWALpdQpLsqd1VZP6IwL\r\nqBmY/zZOzmc+6tJTEMk7n/7uAPQWCDETNwVx6iaJv4Dnql58ifDTMbquZT0s\r\nGKN/27qigKzwLLhcC2pNOvPbbwITX71gB2I=\r\n=XhbS\r\n-----END PGP SIGNATURE-----\r\n","size":3862,"noattachment":false,"key":"/mdast-util-compact/-/mdast-util-compact-4.1.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-compact_4.1.1_1674642654836_0.722837188918044"},"_hasShrinkwrap":false,"readme":"# mdast-util-compact\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[mdast][] utility to make trees compact by collapsing adjacent text nodes and\nblockquotes.\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    *   [`compact(tree)`](#compacttree)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a utility that lets you make a tree, after changes, more similar\nto how it would be parsed.\n\n## When should I use this?\n\nProbably never!\nYou should try and keep your trees clean yourself.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install mdast-util-compact\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {compact} from 'https://esm.sh/mdast-util-compact@5'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {compact} from 'https://esm.sh/mdast-util-compact@5?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {u} from 'unist-builder'\nimport {compact} from 'mdast-util-compact'\n\nconst tree = u('strong', [u('text', 'alpha'), u('text', ' '), u('text', 'bravo')])\n\ncompact(tree)\n\nconsole.log(tree)\n```\n\nYields:\n\n```js\n{\n  type: 'strong',\n  children: [ { type: 'text', value: 'alpha bravo' } ]\n}\n```\n\n## API\n\nThis package exports the identifier [`compact`][api-compact].\nThere is no default export.\n\n### `compact(tree)`\n\nMake an mdast tree compact by merging adjacent text nodes and block quotes.\n\n###### Parameters\n\n*   `tree` ([`Node`][node])\n    — tree to change\n\n###### Returns\n\nNothing (`undefined`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\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, `mdast-util-compact@^5`,\ncompatible with Node.js 16.\n\n## Security\n\nUse of `mdast-util-compact` does not involve **[hast][]** or user content so\nthere are no openings for [cross-site scripting (XSS)][xss] attacks.\n\n## Related\n\n*   [`mdast-squeeze-paragraphs`](https://github.com/syntax-tree/mdast-squeeze-paragraphs)\n    — remove empty paragraphs\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to 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<!-- Definitions -->\n\n[build-badge]: https://github.com/syntax-tree/mdast-util-compact/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-util-compact/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-compact.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-util-compact\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-compact.svg\n\n[downloads]: https://www.npmjs.com/package/mdast-util-compact\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-compact\n\n[size]: https://bundlejs.com/?q=mdast-util-compact\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[node]: https://github.com/syntax-tree/mdast#node\n\n[hast]: https://github.com/syntax-tree/hast\n\n[api-compact]: #compacttree\n","publish_time":1674642654980,"_cnpm_publish_time":1674642654980,"dist-tags":{"latest":"5.0.0"}}