{"name":"mdast-squeeze-paragraphs","version":"3.0.4","description":"Remove empty paragraphs from mdast tree","license":"MIT","keywords":["mdast","squeeze","remove","empty","paragraph","whitespace","ast","transform","transformation","util","clean"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-squeeze-paragraphs.git"},"bugs":{"url":"https://github.com/syntax-tree/mdast-squeeze-paragraphs/issues"},"author":{"name":"Eugene Sharygin","email":"eush77@gmail.com"},"contributors":[{"name":"Eugene Sharygin","email":"eush77@gmail.com"},{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"unist-util-remove":"^1.0.0"},"devDependencies":{"nyc":"^13.0.0","prettier":"^1.14.2","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","unist-builder":"^1.0.0","xo":"^0.23.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"192225d74d8a60018f03d51af52089c735cb6555","homepage":"https://github.com/syntax-tree/mdast-squeeze-paragraphs#readme","_id":"mdast-squeeze-paragraphs@3.0.4","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-sUu55X5JWisBqfiq2pwQv4SnLb11EBua0NWjvcl6WORfV18MdWoyODE2tS4pyqjwXbFTaq3y3Ca/4OMNvx8B0Q==","shasum":"e27affcc8cc854842ff504ebb8f380e3c8e131f8","tarball":"http://registry-npm.ywwl.com/mdast-squeeze-paragraphs/download/mdast-squeeze-paragraphs-3.0.4.tgz","fileCount":4,"unpackedSize":5465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcB49rCRA9TVsSAnZWagAAhesP+wd+9Q6eLKplPYffbP20\ne6rtROyifT/R7l2tECyIFs3L1S4CSN0DkkUsheq6Qac8aZuYvib0ToWsMwDM\nY2kghvUX/Crr2ji5dYbYxaC66hfYpo8SXPHG4Q3bAnIxtU8cs81ptxEq8h57\nueQBtHBllddboQRKDlo329QL8v16ojGG4BAdTOecY/mOmVUXVFrzljxK3Odk\nluS7UFMO5qOWUyJAQDWHHRxlBi08Jx7DShfceGTXqpXVCyZbqnuGBLng3m80\ndn58oP2N3Re73IUzxf7ljUXfhcJJsF0/fbOWhChijBteW4McD4Q0RVO+ontS\nigaeV05TYPWrka6qDrgHgKP1Vuuy7LpT2YCTzFcQb+nbbmtmkfUCe741933O\nYTqueyIpEJQv9zJ/Ju1wHSYzQHz4jW0wb8mlYCgQHuhnw8EmVTank8ucltMS\n3oZNi0tgF1ci938Bm0BGS+j67zZAsoAVfpOhA1hK46vjt+WXLWJW+SQsngAs\n06X1wRGaHt1N6bjMZPlsG5StR8wG/VEBIdtJSa29m4CPlgC7VHcTOxSBy9v+\nzIU/dnUBtyv81066qmA6AZzgCWh9eyADsW2oE0Wt5jns0StMvy7UZFspFBNo\ntVduEDPhiQzzJTpF7Y/t6NmDPMjDX9p992T/gnfjVTp+nwWfxv50GQMGdNTg\nBHCX\r\n=IKG7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6sD/6fmHaNerM8+hZafCENoOAE7vgfAS6PSZHTVb02AiBe3jsZ2f7rnXRjU/WUvw9ia5sXp/a+yU/xhVqYAGXl+g=="}],"size":2532,"noattachment":false,"key":"/mdast-squeeze-paragraphs/-/mdast-squeeze-paragraphs-3.0.4.tgz"},"maintainers":[{"name":"eush77","email":"eush77@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-squeeze-paragraphs_3.0.4_1543999338829_0.6645235901490756"},"_hasShrinkwrap":false,"readme":"# mdast-squeeze-paragraphs\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 remove empty paragraphs.\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    *   [`squeezeParagraphs(tree)`](#squeezeparagraphstree)\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 removes empty paragraphs, left over from other\noperations, from the tree.\nParagraphs are considered empty if they do not contain non-whitespace\ncharacters.\n\n## When should I use this?\n\nProbably never!\nYou should try to clean your trees yourself.\n\nA plugin, [`remark-squeeze-paragraphs`][remark-squeeze-paragraphs], exists that\ndoes the same but for [remark][].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install mdast-squeeze-paragraphs\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {squeezeParagraphs} from 'https://esm.sh/mdast-squeeze-paragraphs@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {squeezeParagraphs} from 'https://esm.sh/mdast-squeeze-paragraphs@6?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {squeezeParagraphs} from 'mdast-squeeze-paragraphs'\nimport {u} from 'unist-builder'\n\nconst tree = u('root', [\n  u('paragraph', []),\n  u('paragraph', [u('text', 'Alpha')]),\n  u('paragraph', [u('text', ' ')])\n])\n\nsqueezeParagraphs(tree)\n\nconsole.dir(tree, {depth: null})\n```\n\nYields:\n\n```js\n{ type: 'root',\n  children:\n   [ { type: 'paragraph',\n       children: [ { type: 'text', value: 'Alpha' } ] } ] }\n```\n\n## API\n\nThis package exports the identifier\n[`squeezeParagraphs`][api-squeezeparagraphs].\nThere is no default export.\n\n### `squeezeParagraphs(tree)`\n\nRemove empty paragraphs in `tree`.\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,\n`mdast-squeeze-paragraphs@^6`, compatible with Node.js 16.\n\n## Security\n\nUse of `mdast-squeeze-paragraphs` does not involve **[hast][]** or user content\nso there are no openings for [cross-site scripting (XSS)][xss] attacks.\n\n## Related\n\n*   [`remark-squeeze-paragraphs`][remark-squeeze-paragraphs]\n    — remark plugin\n*   [`mdast-util-compact`](https://github.com/syntax-tree/mdast-util-compact)\n    — make a tree compact\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] © Eugene Sharygin\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/syntax-tree/mdast-squeeze-paragraphs/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-squeeze-paragraphs/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-squeeze-paragraphs.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-squeeze-paragraphs\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-squeeze-paragraphs.svg\n\n[downloads]: https://www.npmjs.com/package/mdast-squeeze-paragraphs\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-squeeze-paragraphs\n\n[size]: https://bundlejs.com/?q=mdast-squeeze-paragraphs\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[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[hast]: https://github.com/syntax-tree/hast\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[node]: https://github.com/syntax-tree/mdast#node\n\n[remark]: https://github.com/remarkjs/remark\n\n[remark-squeeze-paragraphs]: https://github.com/remarkjs/remark-squeeze-paragraphs\n\n[api-squeezeparagraphs]: #squeezeparagraphstree\n","publish_time":1543999338899,"_cnpm_publish_time":1543999338899,"dist-tags":{"latest":"6.0.0"}}