{"_id":"rehype-recma","_rev":"1-9a87b5def502b6815f6ad1e2cdfea6f5","name":"rehype-recma","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"rehype-recma","version":"1.0.0","keywords":["abstract","ast","compile","estree","hast","html","javascript","jsx","plugin","recma-plugin","recma","rehype-plugin","rehype","syntax","tree","unified"],"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","_id":"rehype-recma@1.0.0","maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://github.com/mdx-js/recma","bugs":{"url":"https://github.com/mdx-js/recma/issues"},"dist":{"shasum":"d68ef6344d05916bd96e25400c6261775411aa76","tarball":"https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz","fileCount":8,"integrity":"sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==","signatures":[{"sig":"MEQCIH9iArpm+V6UyBn11fCXobQlNPvKYLZmz6YqIO9KiCZKAiBnY2tyvkZzWXbSTNP8hZtW6WCH7kwLV3UnenF5j/pxOA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9060},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"0b98a021589d3eb20abd0a2a6fbe06189684b2f9","scripts":{},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"repository":{"url":"git+https://github.com/mdx-js/recma.git#main","type":"git"},"_npmVersion":"10.9.0","description":"recma plugin to transform HTML (hast) to JS (estree)","directories":{},"sideEffects":false,"_nodeVersion":"22.7.0","dependencies":{"@types/hast":"^3.0.0","@types/estree":"^1.0.0","hast-util-to-estree":"^3.0.0"},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rehype-recma_1.0.0_1729251583780_0.56749464198965","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-10-18T11:39:43.779Z","modified":"2024-10-19T08:13:08.369Z","1.0.0":"2024-10-18T11:39:44.004Z"},"bugs":{"url":"https://github.com/mdx-js/recma/issues"},"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","homepage":"https://github.com/mdx-js/recma","keywords":["abstract","ast","compile","estree","hast","html","javascript","jsx","plugin","recma-plugin","recma","rehype-plugin","rehype","syntax","tree","unified"],"repository":{"url":"git+https://github.com/mdx-js/recma.git#main","type":"git"},"description":"recma plugin to transform HTML (hast) to JS (estree)","contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"maintainers":[{"email":"remcohaszing@gmail.com","name":"remcohaszing"},{"email":"johnotander@gmail.com","name":"johno"},{"email":"timneutkens@icloud.com","name":"timneutkens"},{"email":"tituswormer@gmail.com","name":"wooorm"}],"readme":"# rehype-recma\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n[![Sponsors][badge-sponsors-image]][badge-collective-url]\n[![Backers][badge-backers-image]][badge-collective-url]\n[![Chat][badge-chat-image]][badge-chat-url]\n\n**[rehype][github-rehype]** plugin to transform HTML to JS.\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  * [`unified().use(rehypeRecma[, options])`](#unifieduserehyperecma-options)\n  * [`Options`](#options)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][github-unified] ([rehype][github-rehype]) plugin\nthat can turn HTML into JavaScript.\n\n## When should I use this?\n\nUse this when you want to integrate static HTML into some JavaScript\napplication.\n\nIf you don’t use plugins and access syntax trees manually,\nyou can directly use [`hast-util-to-estree`][github-hast-util-to-estree],\nwhich is used inside this plugin.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npm-install]:\n\n```sh\nnpm install rehype-recma\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport rehypeRecma from 'https://esm.sh/rehype-recma@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import rehypeRecma from 'https://esm.sh/rehype-recma@1?bundle'\n</script>\n```\n\n## Use\n\nSay we have the following module `example.js`:\n\n```js\nimport recmaJsx from 'recma-jsx'\nimport recmaStringify from 'recma-stringify'\nimport rehypeParse from 'rehype-parse'\nimport rehypeRecma from 'rehype-recma'\nimport {unified} from 'unified'\n\nconst file = await unified()\n  .use(rehypeParse, {fragment: true})\n  .use(rehypeRecma)\n  .use(recmaJsx)\n  .use(recmaStringify)\n  .process('<p>Hi!<h1>Hello!')\n\nconsole.log(String(file))\n```\n\n…running that with `node example.js` yields:\n\n```jsx\n<><p>{\"Hi!\"}</p><h1>{\"Hello!\"}</h1></>;\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`rehypeRecma`][api-rehype-recma].\n\n### `unified().use(rehypeRecma[, options])`\n\nPlugin to transform HTML (hast) to JS (estree).\n\n###### Parameters\n\n* `options` ([`Options`][api-options], optional)\n  — configuration\n\n###### Returns\n\nTransform ([`Transformer`][github-unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\nSame as [`Options`][github-hast-util-to-estree-options]\nfrom `hast-util-to-estree`.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\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,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`rehype-recma@1`,\ncompatible with Node.js 16.\n\n## Security\n\nAs **recma** works on JS and evaluating JS is unsafe,\nuse of recma can also be unsafe.\nDo not evaluate unsafe code.\n\n## Contribute\n\nSee [§ Contribute][mdxjs-contribute] on our site for ways to get started.\nSee [§ Support][mdxjs-support] for ways to get help.\n\nThis project has a [code of conduct][health-coc].\nBy interacting with this repository,\norganization,\nor community you agree to abide by its terms.\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n<!-- Definitions -->\n\n[api-options]: #options\n\n[api-rehype-recma]: #unifieduserehyperecma-options\n\n[badge-backers-image]: https://opencollective.com/unified/backers/badge.svg\n\n[badge-build-image]: https://github.com/mdx-js/recma/actions/workflows/main.yml/badge.svg\n\n[badge-build-url]: https://github.com/mdx-js/recma/actions\n\n[badge-collective-url]: https://opencollective.com/unified\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/mdx-js/recma.svg\n\n[badge-coverage-url]: https://codecov.io/github/mdx-js/recma\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/rehype-recma.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/rehype-recma\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/rehype-recma\n\n[badge-size-url]: https://bundlejs.com/?q=rehype-recma\n\n[badge-sponsors-image]: https://opencollective.com/unified/sponsors/badge.svg\n\n[badge-chat-image]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[badge-chat-url]: https://github.com/mdx-js/mdx/discussions\n\n[esmsh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-hast-util-to-estree-options]: https://github.com/syntax-tree/hast-util-to-estree#options\n\n[github-hast-util-to-estree]: https://github.com/syntax-tree/hast-util-to-estree\n\n[github-rehype]: https://github.com/rehypejs/rehype\n\n[github-unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[github-unified]: https://github.com/unifiedjs/unified\n\n[health-coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md\n\n[mdxjs-contribute]: https://mdxjs.com/community/contribute/\n\n[mdxjs-support]: https://mdxjs.com/community/support/\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n\n[wooorm]: https://wooorm.com\n","readmeFilename":"readme.md"}