{"name":"@mapbox/hast-util-to-jsx","version":"1.0.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/master/packages/hast-util-to-jsx#readme","keywords":["hast","plugin","markdown","html","react","jsx","transform"],"dependencies":{"kebab-case":"^1.0.0","postcss":"^7.0.31","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.0.0","unist-builder":"^2.0.3"},"engines":{"node":">=10"},"gitHead":"2a5498b8f45875c04e0e2b6b319f36c3e38a4aed","_id":"@mapbox/hast-util-to-jsx@1.0.0","_nodeVersion":"10.18.1","_npmVersion":"lerna/3.22.0/node@v10.18.1+x64 (darwin)","dist":{"integrity":"sha512-HJRp3qkr0uGIBFASzA8rVATLo6y/UoOMoD8eXsG8HVofk5Dokc9PV+dh266zYLZniYgtpJbc2+AKf1fNpsVqAA==","shasum":"90ce46b0d2dde42d5ea4d4a1e0b26b9ce2215013","tarball":"http://registry-npm.ywwl.com/@mapbox/hast-util-to-jsx/download/@mapbox/hast-util-to-jsx-1.0.0.tgz","fileCount":13,"unpackedSize":29195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2VRsCRA9TVsSAnZWagAADzQQAJfP1MAk9MxRh6KsncS0\nuHE3KMwjn8tsE2WIG/zFmsIHpItO/YfHH2GeK/s0ifU7gEglrvf5rXJasZ5P\ndAURn6P/fjibjJynv0MZesJmSUiNBh24cZRohJpYzPT7Gs/k8oVtrhKdU0kK\nI1CLdbeF+KrhJb//fdVAoTToTTE/txLGXdZg5UCFuynlqT+ODxahPSitzF1F\nhJsgCqAY7gNc9WOpNqbQcpafxWH8SpYt0LIQ0ZNI5NH/xlnaEvKNAMGY+FQi\nUxR6P8U5LiUwx1SVDAED67Q8pYlPymNYG+P6EjEK3cnrAJDhyR0Xbqfa2MF1\nMsH1Y23X7mbcmuY8lsBsoZF3BHSQdcqF3nLzEQIKvljVHDqgKPe1T6dm308u\n+Pd+A+9dpdIpKBQVrp7gMhBYF01nNCGlb2VSycVS6ynLABOvUQAYbbWeSr1S\nL/G7GFROZnof91gmCUvQLLqOOditTEMA7fs0ARF3RX2N3PvSqSPEVegD/VxO\nty6OT0EcYFnUCHWXok49kDSphHGGowIdJiYQWeLl8+tulHrTTRjNt1T3K9AE\n3JaYW/b49nfcD/cUDjo6uKWKwmMnoqFxvHHMY8mZv/1sUinwtXvMR+npsUi9\nPCLdjZlpKLqisobOOEGOGQBY4Jyd0fzb/7XsJmeDOXLTRvvP8YeUN5G8lKtK\nthKE\r\n=pfel\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt2PSw8ZDDLiyqQjyp4XyT45F6arBFW9eVnPh4PWMXjQIhAO2xSG9OjMexc6GKTqzXS8UyzgKt0Vh1jUwIjoV/c27z"}],"size":8083,"noattachment":false,"key":"/@mapbox/hast-util-to-jsx/-/@mapbox/hast-util-to-jsx-1.0.0.tgz"},"maintainers":[{"email":"accounts@mapbox.com","name":"mapbox-admin"},{"email":"accounts+npm-mapbox-machine-user@mapbox.com","name":"mapbox-machine-user"},{"email":"accounts+npmjs@mapbox.com","name":"mapbox-npm"},{"email":"accounts+npmjs-01@mapbox.com","name":"mapbox-npm-01"},{"email":"accounts+npmjs-02@mapbox.com","name":"mapbox-npm-02"},{"email":"accounts+npmjs-03@mapbox.com","name":"mapbox-npm-03"},{"email":"accounts+npmjs-04@mapbox.com","name":"mapbox-npm-04"},{"email":"accounts+npmjs-05@mapbox.com","name":"mapbox-npm-05"},{"email":"accounts+npmjs-06@mapbox.com","name":"mapbox-npm-06"},{"email":"accounts+npmjs-07@mapbox.com","name":"mapbox-npm-07"},{"email":"accounts+npmjs-08@mapbox.com","name":"mapbox-npm-08"},{"email":"accounts+npmjs-09@mapbox.com","name":"mapbox-npm-09"},{"email":"accounts+npmjs-advanced-actions@mapbox.com","name":"mapbox-npm-advanced-actions"},{"email":"accounts+npmjs-npm-ci@mapbox.com","name":"mapbox-npm-ci"}],"_npmUser":{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hast-util-to-jsx_1.0.0_1591301228106_0.21194745319039776"},"_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":1591301228260,"_cnpm_publish_time":1591301228260,"dist-tags":{"latest":"2.1.0"}}