{"_id":"recma-build-jsx","_rev":"1-e74e135919abf63e1268de8fcb6897ea","name":"recma-build-jsx","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"recma-build-jsx","version":"1.0.0","keywords":["abstract","ast","build","compile","javascript","jsx","plugin","recma-plugin","recma","runtime","syntax","tree","unified"],"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","_id":"recma-build-jsx@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":"c02f29e047e103d2fab2054954e1761b8ea253c4","tarball":"https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz","fileCount":8,"integrity":"sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==","signatures":[{"sig":"MEUCIQDhqrlMna3bxre0wRp0Y0Bp8HhcC0NZmVx021DnYZ18IAIgLUsc31LhckIzz+ocuAh/Z/f0o816JkwB2/uuWyt/5nw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9527},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"40c2f6e7cb93bd55e7901f201abfc6e2968374f6","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 add support for parsing and serializing JSX","directories":{},"sideEffects":false,"_nodeVersion":"22.7.0","dependencies":{"vfile":"^6.0.0","@types/estree":"^1.0.0","estree-util-build-jsx":"^3.0.0"},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/recma-build-jsx_1.0.0_1729251549194_0.20250553990342746","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-10-18T11:39:09.192Z","modified":"2024-10-19T08:13:08.875Z","1.0.0":"2024-10-18T11:39:09.365Z"},"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","build","compile","javascript","jsx","plugin","recma-plugin","recma","runtime","syntax","tree","unified"],"repository":{"url":"git+https://github.com/mdx-js/recma.git#main","type":"git"},"description":"recma plugin to add support for parsing and serializing JSX","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":"# recma-build-jsx\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**[recma][github-recma]** plugin to add support for turning JSX (`<x />`)\ninto JavaScript (`React.createElement('x', {})` or `_jsx('x', {})`).\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(recmaBuildJsx[, options])`](#unifieduserecmabuildjsx-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]\n([recma][github-recma])\nthat can turn JSX into JavaScript.\n\n## When should I use this?\n\nUse this when preparing JSX for evaluation.\nJSX cannot be evaluated without being transformed first.\n\nIf you don’t use plugins and access syntax trees manually,\nyou can directly use [`estree-util-build-jsx`][github-estree-util-build-jsx],\nwhich is used inside this plugin.\nrecma focusses on making it easier to transform code by abstracting such\ninternals away.\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 recma-build-jsx\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport recmaBuildJsx from 'https://esm.sh/recma-build-jsx@1'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import recmaBuildJsx from 'https://esm.sh/recma-build-jsx@1?bundle'\n</script>\n```\n\n## Use\n\nSay we have the following module `example.js`:\n\n```js\nimport recmaBuildJsx from 'recma-build-jsx'\nimport recmaJsx from 'recma-jsx'\nimport recmaParse from 'recma-parse'\nimport recmaStringify from 'recma-stringify'\nimport {unified} from 'unified'\n\nconst file = await unified()\n  .use(recmaParse)\n  .use(recmaJsx)\n  .use(recmaBuildJsx)\n  .use(recmaStringify)\n  .process('console.log(<em>Hi!</em>)')\n\nconsole.log(String(file))\n```\n\n…running that with `node example.js` yields:\n\n```js\nconsole.log(React.createElement(\"em\", null, \"Hi!\"));\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`recmaBuildJsx`][api-recma-build-jsx].\n\n### `unified().use(recmaBuildJsx[, options])`\n\nPlugin to build JSX.\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-estree-util-build-jsx-options]\nfrom `estree-util-build-jsx`.\nPassing `filePath` is not supported as it is handled for you.\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`recma-build-jsx@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-recma-build-jsx]: #unifieduserecmabuildjsx-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/recma-build-jsx.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/recma-build-jsx\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/recma-build-jsx\n\n[badge-size-url]: https://bundlejs.com/?q=recma-build-jsx\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-estree-util-build-jsx-options]: https://github.com/syntax-tree/estree-util-build-jsx#options\n\n[github-estree-util-build-jsx]: https://github.com/syntax-tree/estree-util-build-jsx\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-recma]: https://github.com/mdx-js/recma\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"}