{"_id":"recma-nextjs-static-props","_rev":"4-17a2ce4c659bafbeeb2596d7489ce850","name":"recma-nextjs-static-props","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"recma-nextjs-static-props","version":"1.0.0","keywords":["estree","mdx","next","next.js","recma","recma-plugin","unified"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"recma-nextjs-static-props@1.0.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/recma-nextjs-static-props#readme","bugs":{"url":"https://github.com/remcohaszing/recma-nextjs-static-props/issues"},"dist":{"shasum":"99c1f0782adf0f5c43e78a2a8991c8e0f42031d8","tarball":"https://registry.npmjs.org/recma-nextjs-static-props/-/recma-nextjs-static-props-1.0.0.tgz","fileCount":5,"integrity":"sha512-szo+rOZFU6mR0YWZi3e3dSqcEQU+E0f7GIyfMfntHeJccH1s9ODP0HWUeK7No0lcY1smRCcC43JrpoekzuX4Aw==","signatures":[{"sig":"MEQCIGN60zmhkbkeA/nhCZh/fl7OPHeba/Fyv1LgGErTiKmAAiAKRXRF5a12y3rC8xV0W/vhvhpsepKupYokNfsblsVn0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJin4mAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYFRAAoSRh+XdHiwAGc9FVEPB+hBDTajwtIehESkxvh++cjKTvldn2\r\nvaaNmkel9qhUzMgR1fL8BDHrbagI4BL1xfyuQlEx/agiR/oYNjBzmBUS/SQ2\r\nnAa3pOf2/L64KVfm2mCMwlcEBmRXQ6KIUqrMBuoY/ooKgRZnKu3jZD0KcxxX\r\n8FSEW7t3Qqk6zePi3qj/39UPkdKNeyFCWoBaT8nGQ4vhZb/zx8/8nZ5pEii3\r\nbIkuXWSZp7wCsbanf5rRsVZTrxNBTHz0EusmdezJSQpQn3tZfyJbQBIVT+qZ\r\nfTlZSRLxx5x/C14VLe08s8XsP5jWv7kkAibbTQX07iO5Ayf3tgjNbLZsaAxN\r\nmbKVmOAqMFDrfxpXqPrls7aPt3Ru0u8zG5q7K/tfZJ+p+xZDN2JPGq0Z1VRt\r\nEVqyd6fmsA/5h/81G6DO0XBZMn1vYIi13rZeoWPGoUNExgy1zJJBvwxAMnKR\r\ncXgUcrTcyD0L+Esdrhz1PWx+k2T3BhEM8HnEV4B37Ur7/CfWkUAGKHlsyJSX\r\naZJ4jBEm2lEpn5PHABPx8RV6IfR5A+DufHKUjondJfR8ojYxTe7wkt3MXd8X\r\n/z7DSP305iJBnIB2SsTXQtewvge7nKquSLdbRRhIr+qGaSf4LYB2iJ7/jZV3\r\n74yKLMsebTgzKb2uOVl/5sotdV1h9wnTfsQ=\r\n=QCel\r\n-----END PGP SIGNATURE-----\r\n"},"type":"module","types":"./index.d.ts","engines":{"node":">=14.0.0"},"exports":"./index.js","gitHead":"949616d6d93717e51effdfb57aec6c6487bed594","scripts":{"dev":"next dev","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","prepack":"tsc --noEmit false --emitDeclarationOnly true"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"repository":{"url":"git+https://github.com/remcohaszing/recma-nextjs-static-props.git","type":"git"},"_npmVersion":"8.12.1","description":"Generate getStaticProps exposing top level identifiers","directories":{},"_nodeVersion":"16.15.1","dependencies":{"unified":"^10.0.0","periscopic":"^3.0.0","@types/estree":"*"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^28.0.0","next":"^12.0.0","react":"^18.0.0","eslint":"^8.0.0","prettier":"^2.0.0","@next/mdx":"^12.0.0","react-dom":"^18.0.0","typescript":"^4.0.0","@mdx-js/mdx":"^2.0.0","@types/jest":"^27.0.0","strip-indent":"^4.0.0","rehype-mdx-title":"^1.0.0","eslint-plugin-jest":"^26.0.0","remark-frontmatter":"^4.0.0","eslint-plugin-react":"^7.0.0","eslint-plugin-jsx-a11y":"^6.0.0","remark-mdx-frontmatter":"^1.0.0","eslint-plugin-react-hooks":"^4.0.0","eslint-config-remcohaszing":"^4.0.0","eslint-plugin-jest-formatting":"^3.0.0","@typescript-eslint/eslint-plugin":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/recma-nextjs-static-props_1.0.0_1654622592019_0.8628896314275598","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"recma-nextjs-static-props","version":"2.0.0","keywords":["estree","mdx","next","next.js","recma","recma-plugin","unified"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"recma-nextjs-static-props@2.0.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/recma-nextjs-static-props#readme","bugs":{"url":"https://github.com/remcohaszing/recma-nextjs-static-props/issues"},"dist":{"shasum":"ed60b2412ff5f549a6c669f32dbc685914ce3250","tarball":"https://registry.npmjs.org/recma-nextjs-static-props/-/recma-nextjs-static-props-2.0.0.tgz","fileCount":6,"integrity":"sha512-Q72YZ8EyUF87mqzO/FE2MQNvSHBgpENoiUwJzO3NABmtMdVxGEZNVMHL70TFsz6SJEFMBFqmjx3io3whbLRyhg==","signatures":[{"sig":"MEYCIQC/9W3UwD/UXGnFY1nwk9h8Q9olT+uSbTR0mG4pr3pwIQIhAN7zK89Wn9Z9YpAT029nXNGUhtnlF0qxNFnlv+OaH5sc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-nextjs-static-props@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12610},"type":"module","_from":"file:recma-nextjs-static-props-2.0.0.tgz","types":"./index.d.ts","exports":"./index.js","scripts":{"dev":"next dev","test":"node --test","prepack":"tsc --noEmit false --emitDeclarationOnly true"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/recma-nextjs-static-props/recma-nextjs-static-props/recma-nextjs-static-props-2.0.0.tgz","_integrity":"sha512-Q72YZ8EyUF87mqzO/FE2MQNvSHBgpENoiUwJzO3NABmtMdVxGEZNVMHL70TFsz6SJEFMBFqmjx3io3whbLRyhg==","repository":{"url":"git+https://github.com/remcohaszing/recma-nextjs-static-props.git","type":"git"},"_npmVersion":"10.1.0","description":"Generate getStaticProps exposing top level identifiers","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unified":"^11.0.0","periscopic":"^4.0.0","@types/estree":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"next":"^14.0.0","react":"^18.0.0","eslint":"^8.0.0","prettier":"^3.0.0","@next/mdx":"^14.0.0","react-dom":"^18.0.0","remark-cli":"^11.0.0","typescript":"^5.0.0","@types/react":"^18.0.0","@mdx-js/react":"^3.0.0","@mdx-js/loader":"^3.0.0","rehype-mdx-title":"^3.0.0","remark-frontmatter":"^5.0.0","eslint-plugin-react":"^7.0.0","eslint-plugin-jsx-a11y":"^6.0.0","remark-mdx-frontmatter":"^4.0.0","eslint-plugin-react-hooks":"^4.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/recma-nextjs-static-props_2.0.0_1698421882585_0.25018265105623083","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"recma-nextjs-static-props","version":"2.0.1","keywords":["estree","mdx","next","next.js","recma","recma-plugin","unified"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"recma-nextjs-static-props@2.0.1","homepage":"https://github.com/remcohaszing/recma-nextjs-static-props#readme","bugs":{"url":"https://github.com/remcohaszing/recma-nextjs-static-props/issues"},"dist":{"shasum":"98a9969a8078a2d34368c34f31c5f9d1c6ec1691","tarball":"https://registry.npmjs.org/recma-nextjs-static-props/-/recma-nextjs-static-props-2.0.1.tgz","fileCount":6,"integrity":"sha512-XNQmiJYLcIzm130clZM0rzcGnAz9xhO6YX1z7vJIoE6Ve//+vxOtvES++MvwPpnGoIpPVP4V3nGCgt6ROsq2gw==","signatures":[{"sig":"MEQCIE+ne/8QdEWQxXH0OIcYidVO7CfD0PaKA+syO6dC9H6dAiAurh3Dyk0SEJHvDpL6J6LeFwF41ZVGdiY1nAEyR+SJcQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-nextjs-static-props@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":13106},"type":"module","_from":"file:recma-nextjs-static-props-2.0.1.tgz","types":"./types/recma-nextjs-static-props.d.ts","exports":{"types":"./types/recma-nextjs-static-props.d.ts","default":"./lib/recma-nextjs-static-props.js"},"funding":"https://github.com/sponsors/remcohaszing","scripts":{"dev":"next dev","test":"c8 node test.js","prepack":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/recma-nextjs-static-props/recma-nextjs-static-props/recma-nextjs-static-props-2.0.1.tgz","_integrity":"sha512-XNQmiJYLcIzm130clZM0rzcGnAz9xhO6YX1z7vJIoE6Ve//+vxOtvES++MvwPpnGoIpPVP4V3nGCgt6ROsq2gw==","repository":{"url":"git+https://github.com/remcohaszing/recma-nextjs-static-props.git","type":"git"},"_npmVersion":"10.7.0","description":"Generate getStaticProps exposing top level identifiers","directories":{},"_nodeVersion":"20.15.0","dependencies":{"unified":"^11.0.0","periscopic":"^3.0.0","@types/estree":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^9.0.0","next":"^14.0.0","react":"^18.0.0","eslint":"^8.0.0","prettier":"^3.0.0","@next/mdx":"^14.0.0","react-dom":"^18.0.0","remark-cli":"^12.0.0","typescript":"^5.0.0","@types/react":"^18.0.0","@mdx-js/react":"^3.0.0","@mdx-js/loader":"^3.0.0","rehype-mdx-title":"^3.0.0","snapshot-fixtures":"^1.0.0","remark-frontmatter":"^5.0.0","eslint-plugin-react":"^7.0.0","eslint-plugin-jsx-a11y":"^6.0.0","remark-mdx-frontmatter":"^5.0.0","eslint-plugin-react-hooks":"^4.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^3.0.0"},"_npmOperationalInternal":{"tmp":"tmp/recma-nextjs-static-props_2.0.1_1719911645856_0.9545291004242951","host":"s3://npm-registry-packages"}},"2.0.2":{"name":"recma-nextjs-static-props","version":"2.0.2","description":"Generate getStaticProps exposing top level identifiers","type":"module","author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/remcohaszing/recma-nextjs-static-props.git"},"bugs":{"url":"https://github.com/remcohaszing/recma-nextjs-static-props/issues"},"homepage":"https://github.com/remcohaszing/recma-nextjs-static-props#readme","funding":"https://github.com/sponsors/remcohaszing","keywords":["estree","mdx","next","next.js","recma","recma-plugin","unified"],"types":"./types/recma-nextjs-static-props.d.ts","exports":{"types":"./types/recma-nextjs-static-props.d.ts","default":"./lib/recma-nextjs-static-props.js"},"scripts":{"dev":"next dev","test":"c8 node test.js","prepack":"tsc --build"},"dependencies":{"@types/estree":"^1.0.0","estree-util-scope":"^1.0.0","estree-walker":"^3.0.0","unified":"^11.0.0","unist-util-mdx-define":"^1.0.0"},"devDependencies":{"@mdx-js/loader":"^3.0.0","@next/mdx":"^15.0.0","@types/react":"^19.0.0","c8":"^9.0.0","eslint":"^8.0.0","eslint-config-remcohaszing":"^10.0.0","eslint-plugin-jsx-a11y":"^6.0.0","eslint-plugin-react":"^7.0.0","eslint-plugin-react-hooks":"^4.0.0","next":"^15.0.0","prettier":"^3.0.0","react":"^19.0.0","react-dom":"^19.0.0","rehype-mdx-title":"^3.0.0","remark-cli":"^12.0.0","remark-frontmatter":"^5.0.0","remark-mdx-frontmatter":"^5.0.0","remark-preset-remcohaszing":"^3.0.0","snapshot-fixtures":"^1.0.0","typescript":"^5.0.0"},"_id":"recma-nextjs-static-props@2.0.2","_integrity":"sha512-jLrafB7mVYvkSKM5HYE+EVOk1KnGnR0djYJMCI7W03iET08+5b/c08AZmVantOdtYJXrsbiDOKCYupBqmQui+g==","_resolved":"/home/runner/work/recma-nextjs-static-props/recma-nextjs-static-props/recma-nextjs-static-props-2.0.2.tgz","_from":"file:recma-nextjs-static-props-2.0.2.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-jLrafB7mVYvkSKM5HYE+EVOk1KnGnR0djYJMCI7W03iET08+5b/c08AZmVantOdtYJXrsbiDOKCYupBqmQui+g==","shasum":"84f1470fe21fd90a7bc7b8735ab3221ced7be9f1","tarball":"https://registry.npmjs.org/recma-nextjs-static-props/-/recma-nextjs-static-props-2.0.2.tgz","fileCount":6,"unpackedSize":12822,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-nextjs-static-props@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDt4uNi6+FD1VkpvZZBEqWZlBXYxPZYl5VSxjTS2Qa1nQIhAI/VwnqCL2Q/6TCXPpZQecg8Z7KBiHH+6gR8tmsTBBSz"}]},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"directories":{},"maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/recma-nextjs-static-props_2.0.2_1742764760529_0.4853563813020185"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-07T17:23:12.018Z","modified":"2025-03-23T21:19:21.127Z","1.0.0":"2022-06-07T17:23:12.199Z","2.0.0":"2023-10-27T15:51:22.777Z","2.0.1":"2024-07-02T09:14:06.011Z","2.0.2":"2025-03-23T21:19:20.716Z"},"bugs":{"url":"https://github.com/remcohaszing/recma-nextjs-static-props/issues"},"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","homepage":"https://github.com/remcohaszing/recma-nextjs-static-props#readme","keywords":["estree","mdx","next","next.js","recma","recma-plugin","unified"],"repository":{"type":"git","url":"git+https://github.com/remcohaszing/recma-nextjs-static-props.git"},"description":"Generate getStaticProps exposing top level identifiers","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"readme":"# recma-nextjs-static-props\n\n[![ci](https://github.com/remcohaszing/recma-nextjs-static-props/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/recma-nextjs-static-props/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/remcohaszing/recma-nextjs-static-props/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/recma-nextjs-static-props)\n[![npm version](https://img.shields.io/npm/v/recma-nextjs-static-props)](https://www.npmjs.com/package/recma-nextjs-static-props)\n[![npm downloads](https://img.shields.io/npm/dm/recma-nextjs-static-props)](https://www.npmjs.com/package/recma-nextjs-static-props)\n\nGenerate [`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)\nexposing top level identifiers\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [Options](#options)\n- [Example](#example)\n- [Compatibility](#compatibility)\n- [Related Projects](#related-projects)\n- [License](#license)\n\n## Installation\n\n```sh\nnpm install recma-nextjs-static-props\n```\n\n## Usage\n\nThis plugin is intended for use with [Next.js](https://nextjs.org) and [MDX](https://mdxjs.com). It\ninjects a `getStaticProps` function which exposes all top level identifiers. This means these\nvariable are available in [`pages/_app.js`](https://nextjs.org/docs/advanced-features/custom-app).\n\n```js\nimport nextMDX from '@next/mdx'\nimport recmaNextjsStaticProps from 'recma-nextjs-static-props'\n\nconst withMDX = nextMDX({\n  options: {\n    recmaPlugins: [recmaNextjsStaticProps]\n  }\n})\n\nexport default withMDX()\n```\n\nThis roughly transforms the following MDX:\n\n```mdx\nexport const title = 'My document'\nexport const description = 'This is my document'\n\nHello Next\n```\n\ninto the following JavaScript:\n\n```js\nimport { jsx } from 'react/jsx-runtime'\n\nexport const title = 'My document'\nexport const description = 'This is my document'\n\nexport default function MDXContent() {\n  return jsx('p', { children: ['Hello Next'] })\n}\n\nexport const getStaticProps = () => ({\n  props: JSON.parse(\n    JSON.stringify({\n      description,\n      title\n    })\n  )\n})\n```\n\n## API\n\nThe default export is a recma plugin which exposes variables from the top-level scope in\n[Next.js](https://nextjs.org) through `getStaticProps`.\n\n### Options\n\n- `name`: The name of the export to generate. (Default: `'getStaticProps'`)\n- `include`: A list to filter identifiers to include in the generated function. This list may\n  include strings which must be matched exactly, a regular expression to test against, or a function\n  that will be called with the value to test, and must return a boolean. If a value is specified\n  which doesn’t exist in the document, it will be ignored. By default everything will be included.\n- `exclude`: The same as `include`, but matching values will be excluded instead.\n\n## Example\n\nThe source code repository for this plugin is setup as a [Next.js](https://nextjs.org) project. It\nuses both [`rehype-mdx-title`](https://github.com/remcohaszing/rehype-mdx-title) and\n[`remark-mdx-frontmatter`](https://github.com/remcohaszing/remark-mdx-frontmatter).\n\nTo try it yourself, simply clone, install, and run this project:\n\n```sh\ngit clone https://github.com/remcohaszing/recma-nextjs-static-props.git\ncd recma-nextjs-static-props\nnpm ci\nnpm run dev\n```\n\n## Compatibility\n\nThis project is compatible with Node.js 16 or greater.\n\n## Related Projects\n\nThis plugin works well with the following [MDX](https://mdxjs.com) plugins:\n\n- [`rehype-mdx-title`](https://github.com/remcohaszing/rehype-mdx-title)\n- [`remark-mdx-frontmatter`](https://github.com/remcohaszing/remark-mdx-frontmatter)\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","readmeFilename":"README.md"}