{"name":"hast-util-to-parse5","version":"5.0.0","description":"Transform HAST to Parse5’s AST","license":"MIT","keywords":["hast","parse5","ast","utility"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/hast-util-to-parse5.git"},"bugs":{"url":"https://github.com/syntax-tree/hast-util-to-parse5/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"hast-to-hyperscript":"^6.0.0","property-information":"^5.0.0","web-namespaces":"^1.0.0","xtend":"^4.0.1","zwitch":"^1.0.0"},"devDependencies":{"browserify":"^16.0.0","json-stringify-safe":"^5.0.1","nyc":"^13.0.0","parse5":"^5.0.0","prettier":"^1.13.5","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","tinyify":"^2.4.3","xo":"^0.23.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify . -s hastUtilToParse5 > hast-util-to-parse5.js","build-mangle":"browserify . -s hastUtilToParse5 -p tinyify > hast-util-to-parse5.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test","test":"npm run format && npm run build && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"guard-for-in":"off"},"ignores":["hast-util-to-parse5.js"]},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"0bdbfb8479aad107f986303de1ad4f0117be2e3e","homepage":"https://github.com/syntax-tree/hast-util-to-parse5#readme","_id":"hast-util-to-parse5@5.0.0","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-1BG07SLp9RHnAy/A2Fugza5YCo45Ter8csOGbxL7a7f9Rvq9aE64/4hlqc083M8yLLp7J5tYxmiFWYbD0zQJnA==","shasum":"1041df0d57e60210bd3e4b97596397500223399a","tarball":"http://registry-npm.ywwl.com/hast-util-to-parse5/download/hast-util-to-parse5-5.0.0.tgz","fileCount":4,"unpackedSize":8865,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb4y8+CRA9TVsSAnZWagAAHegP/jYcuVHLTrHuiTu1nvPX\nN1f60oA+spRwg/+fDNzhj1vhcNU2kLX24SBrnkVKBaA6MLOSLwtj772+Ep89\nC/8HPm9kFDa4gj9dUNi+Md/Ws54KrgTJ/6RJjtoaEqiBNKwETqbNyMdj2Oju\nR+2dLbnhiwbrMmzPg4zsZkrMorbfxLWG1KTo8HUbQ2R85WZrcPW9/PKVScb4\nr7pnj0etZrkzpu65zM4u1hH490Ebb73vLhLWSJd5xVg1omsEZgmHhiS4ZiVI\nVQiAW3UxyMHzt2yjPok56+M0na01qabddMyBfChEzax5SZTqvljcsF4zcCla\n6eGDkNlC1T5mzjK2Y9+oMKN6MZBCEeKsR/LaKLtdoEaPgfWrP4TK4rG2GwiK\n4i08mMs+NaTyxvoi6OJKk/w42YRTtVYBv/p8tjotlLUZ1YvWJCsgfXvXoyoL\njv+U61NmlXOWMDzQH018t8BI59J6IFMZDXPsKV5cuATmS62TMZsz6t25flfK\n7joc0OMmlzApYBNq34KsSdfCiE6Qf1udOJcWlh7L6FRXCr4CHvH/a317fM6p\njXnxgJO3Z33D5tRBEBp8YctCOF00cgcg/zZOcqdQukTQVgW/4byxuk/15klC\nWZFegQoW/moGYR/3jATo84/oUbLoD8UO3fmmYOh4QiNc72p2ghP5zHS+HAzi\n0akS\r\n=34c/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFee2CbvFpVVf3ZqpPawFgMo3krorTpsRT0+1ihyEITBAiEAtsoyL5phgol6Fs24FvRRInDF8DYvwsQvsqmeqGHR4Lc="}],"size":3634,"noattachment":false,"key":"/hast-util-to-parse5/-/hast-util-to-parse5-5.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-to-parse5_5.0.0_1541615421513_0.5697239025036378"},"_hasShrinkwrap":false,"readme":"# hast-util-to-parse5\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[hast][] utility to transform to a [`parse5`][parse5] [AST][parse5-node].\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    *   [`toParse5(tree[, options])`](#toparse5tree-options)\n    *   [`Options`](#options)\n    *   [`Space`](#space)\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 can turn a hast syntax tree into a `parse5` AST.\nWhy not use a Parse5 adapter, you might ask?\nWell, because it’s more code weight to use adapters, and more fragile.\n\n## When should I use this?\n\nThis package is useful when working with `parse5`, and for some reason want to\ngenerate its AST again.\nThe inverse utility, [`hast-util-from-parse5`][hast-util-from-parse5], is more\nlikely what you want.\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-to-parse5\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {toParse5} from 'https://esm.sh/hast-util-to-parse5@8'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {toParse5} from 'https://esm.sh/hast-util-to-parse5@8?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {toParse5} from 'hast-util-to-parse5'\n\nconst tree = toParse5({\n  type: 'element',\n  tagName: 'h1',\n  properties: {},\n  children: [{type: 'text', value: 'World!'}]\n})\n\nconsole.log(tree)\n```\n\nYields:\n\n```js\n{ nodeName: 'h1',\n  tagName: 'h1',\n  attrs: [],\n  namespaceURI: 'http://www.w3.org/1999/xhtml',\n  childNodes: [ { nodeName: '#text', value: 'World!', parentNode: [Circular] } ] }\n```\n\n## API\n\nThis package exports the identifier [`toParse5`][api-to-parse5].\nThere is no default export.\n\n### `toParse5(tree[, options])`\n\nTransform a hast tree to a `parse5` AST.\n\n###### Parameters\n\n*   `tree` ([`HastNode`][hast-node])\n    — tree to transform\n*   `options` ([`Options`][api-options], optional)\n    — configuration\n\n###### Returns\n\n`parse5` node ([`Parse5Node`][parse5-node]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `space` ([`Space`][api-space], optional)\n    — which space the document is in\n\n### `Space`\n\nNamespace (TypeScript type).\n\n###### Type\n\n```ts\ntype Space = 'html' | 'svg'\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Options`][api-options] and\n[`Space`][api-space].\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, `hast-util-to-parse5@^8`,\ncompatible with Node.js 16.\n\n## Security\n\nUse of `hast-util-to-parse5` can open you up to a\n[cross-site scripting (XSS)][xss] attack if the hast tree is unsafe.\n\n## Related\n\n*   [`hast-util-from-parse5`](https://github.com/syntax-tree/hast-util-from-parse5)\n    — transform from Parse5’s AST to hast\n*   [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)\n    — transform hast to nlcst\n*   [`hast-util-to-mdast`](https://github.com/syntax-tree/hast-util-to-mdast)\n    — transform hast to mdast\n*   [`hast-util-to-xast`](https://github.com/syntax-tree/hast-util-to-xast)\n    — transform hast to xast\n*   [`mdast-util-to-hast`](https://github.com/syntax-tree/mdast-util-to-hast)\n    — transform mdast to hast\n*   [`mdast-util-to-nlcst`](https://github.com/syntax-tree/mdast-util-to-nlcst)\n    — transform mdast to nlcst\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/hast-util-to-parse5/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/hast-util-to-parse5/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-to-parse5.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/hast-util-to-parse5\n\n[downloads-badge]: https://img.shields.io/npm/dm/hast-util-to-parse5.svg\n\n[downloads]: https://www.npmjs.com/package/hast-util-to-parse5\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-to-parse5\n\n[size]: https://bundlejs.com/?q=hast-util-to-parse5\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[hast]: https://github.com/syntax-tree/hast\n\n[hast-node]: https://github.com/syntax-tree/hast#nodes\n\n[parse5]: https://github.com/inikulin/parse5\n\n[parse5-node]: https://github.com/inikulin/parse5/blob/master/packages/parse5/lib/tree-adapters/default.ts\n\n[hast-util-from-parse5]: https://github.com/syntax-tree/hast-util-from-parse5\n\n[api-to-parse5]: #toparse5tree-options\n\n[api-options]: #options\n\n[api-space]: #space\n","publish_time":1541615421613,"_cnpm_publish_time":1541615421613,"dist-tags":{"latest":"8.0.1"}}