{"name":"@mapbox/hast-util-to-jsx","version":"1.1.0","description":"Transform HAST to JSX","main":"index.js","repository":{"type":"git","url":"git+https://github.com/mapbox/jsxtreme-markdown.git"},"author":{"name":"Mapbox"},"license":"MIT","bugs":{"url":"https://github.com/mapbox/jsxtreme-markdown/issues"},"homepage":"https://github.com/mapbox/jsxtreme-markdown/tree/main/packages/hast-util-to-jsx#readme","keywords":["hast","plugin","markdown","html","react","jsx","transform"],"dependencies":{"kebab-case":"^1.0.0","postcss":"^7.0.39","postcss-js":"^2.0.3","property-information":"^5.5.0","react-attr-converter":"^0.3.1","stringify-entities":"^3.0.1","stringify-object":"^3.3.0"},"devDependencies":{"hastscript":"^5.1.2","rehype-parse":"^6.0.2","unified":"^9.2.2","unist-builder":"^2.0.3"},"engines":{"node":">=14"},"gitHead":"6266875b9ab75a54f5a41a8486a92bbb3b2e52eb","_id":"@mapbox/hast-util-to-jsx@1.1.0","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (darwin)","dist":{"integrity":"sha512-VvtIstB/gOLwtHJL4VjS910YGwTS6bEQ5wRQfX0E/Eo1HV4lV5QvT9BDSxNh4RN3HEwWQNZIRuVlL1pFH9tmWA==","shasum":"fdfef81069974b906dbc10d3307820ebda16e71a","tarball":"http://registry-npm.ywwl.com/@mapbox/hast-util-to-jsx/download/@mapbox/hast-util-to-jsx-1.1.0.tgz","fileCount":13,"unpackedSize":29250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlmubCRA9TVsSAnZWagAAvFQP/0hfhtZ0ZHcB0qhwgI7a\nHRoPBH7kbtwlgyjtJMx63SxavfN9hut1k9m0s1TolRQLrdh/7HUrhLS2Al2H\nDfzW+eN4/8QKEby6diGdQCG/bxi28/L/jf1YrPM0huQpSDfxTdlXNtOuyAMW\nYZusxa42VUvc9d2CsvQ3Zn/c3OAvVedhbQnZn2tld935et8cXM8vF79gV5kJ\nMQUC0CY53IqtcZuh1YLzL9euMSzsJ7ircSlSEgxM0W2KcwP90RYy9IFWMe5Y\nMyIZ/JLuM/dLcwbXFKYVFd16LMJoBzuU6/wEh0iqck/kvnMaUFL/MOdQ5Je3\n+3FoqrOMt2ZxKydmhPgxQJUnUzfZZPvHqBQiUAZeHOVgIEiGAp8TO2A8XDmB\nrIo7XIJRWX4Abr+dYid5pX9FM55mRwjklxa1MLW+JAYfHd2ASZD7zq7pJEf9\nRkd8O9lMhbC5io6VPGqTuw4uVHtFi4lI0jBOGNYHvx3bUpJRN673ckiSvo/5\nJfGeHleyj0EiIZUFrVTiFQGS/GjKmnrQaDRN61a4pnZZyFPwLDdt4o85lSVq\nkVELf6RW2YlTGWsXvTe5d6QflMIA6U7L56a3DU09LoZahq6mxgUhCG+MQP+o\nYxeOnvE6oPjfFEUscgiDuChA050Gamdctkem+OcDTaIf94mY4I3BJ6Crsv46\nUUUn\r\n=aRFW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAmff4/dY9MRt1cnxACYHGYtksgn94rxbCBhdhK/s/OAiEAme1aUNA/weu3zePcUfiUGMnIUIjAIMhnGQAjeJde0W0="}],"size":8087,"noattachment":false,"key":"/@mapbox/hast-util-to-jsx/-/@mapbox/hast-util-to-jsx-1.1.0.tgz"},"_npmUser":{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},"directories":{},"maintainers":[{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-to-jsx_1.1.0_1637247899538_0.10733938400819643"},"_hasShrinkwrap":false,"readme":"# @mapbox/hast-util-to-jsx\n\nTransform [HAST](https://github.com/syntax-tree/hast) to JSX.\n\n## Installation\n\n```\nnpm install @mapbox/hast-util-to-jsx\n```\n\n## Usage\n\n```js\nconst h = require('hyperscript');\nconst toJsx = require('@mapbox/hast-util-to-jsx');\n\nconst tree = h('div.one.two', id: 'bar' }, [\n  h('p.hidden', { ariaHidden: true }, ['hidden text']),\n  h('p', { style: 'color: pink; font-size: 2em;' }, ['fancy text'])\n]);\n\nconsole.log(toJsx(tree));\n```\n\nYields (with whitespace collapsed):\n\n```jsx\n<div className=\"one two\" id=\"bar\">\n  <p className=\"hidden\" aria-hidden={true}>hidden text</p>\n  <p style={{color: \"pink\", fontSize: \"2em\"}}>fancy text</p>\n</div>\n```\n\nA few libraries exist to transform HTML to JSX.\nUsing this util, you can perform that transformation entirely within the ecosystem of [`unified`](https://github.com/unifiedjs/unified) syntax trees, using [`rehype`](https://github.com/rehypejs/rehype) to parse HTML and this util to stringify the tree into JSX.\n\n## Related\n\n- [`hast-util-to-html`](https://github.com/syntax-tree/hast-util-to-html) — Transform HAST to HTML.\n- [`rehype`](https://github.com/rehypejs/rehype) — Process HTML as HAST.\n","publish_time":1637247899709,"_cnpm_publish_time":1637247899709,"dist-tags":{"latest":"2.1.0"}}