{"_id":"recma-export-filepath","_rev":"3-329af52cb37083cabfb7de707df03c0f","name":"recma-export-filepath","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"recma-export-filepath","version":"1.0.0","keywords":["estree","mdx","recma","unified"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"recma-export-filepath@1.0.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/recma-export-filepath#readme","bugs":{"url":"https://github.com/remcohaszing/recma-export-filepath/issues"},"dist":{"shasum":"27defcea7ef645e69479c2ff785b858847d9c151","tarball":"https://registry.npmjs.org/recma-export-filepath/-/recma-export-filepath-1.0.0.tgz","fileCount":6,"integrity":"sha512-WgOHC6xKmG8/U2IAfkD8QHsQEBz/MAMM6q9wWahrvqbleSsCzEx724GIqoLbXWv3CUPvQNpMvhfybsPHX3tTWQ==","signatures":[{"sig":"MEYCIQDYK5l23wrnBniLdWgK3FjVqmfs0zocXkupSeDcsu9BlwIhAKnPqKV2Y2pZ7sZvYHoPW1Dt/XZc/bjCPZUSIWsybDkj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-export-filepath@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":6686},"type":"module","_from":"file:recma-export-filepath-1.0.0.tgz","types":"./index.d.ts","exports":"./index.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"c8 node --test","prepack":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/recma-export-filepath/recma-export-filepath/recma-export-filepath-1.0.0.tgz","_integrity":"sha512-WgOHC6xKmG8/U2IAfkD8QHsQEBz/MAMM6q9wWahrvqbleSsCzEx724GIqoLbXWv3CUPvQNpMvhfybsPHX3tTWQ==","repository":{"url":"git+https://github.com/remcohaszing/recma-export-filepath.git","type":"git"},"_npmVersion":"10.1.0","description":"A recma plugin to expose the filepath as a named export","directories":{},"sideEffects":false,"_nodeVersion":"20.8.0","dependencies":{"unified":"^11.0.0","@types/estree":"^1.0.0","normalize-path":"^3.0.0","estree-util-is-identifier-name":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","acorn":"^8.0.0","eslint":"^8.0.0","astring":"^1.0.0","prettier":"^3.0.0","remark-cli":"^11.0.0","source-map":"^0.7.0","typescript":"^5.0.0","eslint-plugin-react":"^7.0.0","@types/normalize-path":"^3.0.0","eslint-plugin-jsx-a11y":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/recma-export-filepath_1.0.0_1697116311241_0.7185449095689354","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"recma-export-filepath","version":"1.1.0","keywords":["estree","mdx","recma","unified"],"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","_id":"recma-export-filepath@1.1.0","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"homepage":"https://github.com/remcohaszing/recma-export-filepath#readme","bugs":{"url":"https://github.com/remcohaszing/recma-export-filepath/issues"},"dist":{"shasum":"48e733bef5143ca21854addb884dd8ac8aa46875","tarball":"https://registry.npmjs.org/recma-export-filepath/-/recma-export-filepath-1.1.0.tgz","fileCount":6,"integrity":"sha512-Xvs7R84WI72PxORtkusu1pwzgrqfXX+7TzFBdUBv1fZreB4F0a9xWI+3zH1pvciS+PkkuwfYAt26wMmEl3Yp3w==","signatures":[{"sig":"MEYCIQCLG8TT4Vm6uZ5nkMNwdjx6ndPL8J+rjiquylk8OKBosAIhAJAjZNMNv+SkA8gv34NtJ6MtNUkzkbV8uOTYtYQ3IdwX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-export-filepath@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":7064},"type":"module","_from":"file:recma-export-filepath-1.1.0.tgz","types":"./index.d.ts","exports":"./index.js","funding":"https://github.com/sponsors/remcohaszing","scripts":{"test":"c8 node --test","prepack":"tsc --build"},"_npmUser":{"name":"remcohaszing","email":"remcohaszing@gmail.com"},"_resolved":"/home/runner/work/recma-export-filepath/recma-export-filepath/recma-export-filepath-1.1.0.tgz","_integrity":"sha512-Xvs7R84WI72PxORtkusu1pwzgrqfXX+7TzFBdUBv1fZreB4F0a9xWI+3zH1pvciS+PkkuwfYAt26wMmEl3Yp3w==","repository":{"url":"git+https://github.com/remcohaszing/recma-export-filepath.git","type":"git"},"_npmVersion":"10.2.4","description":"A recma plugin to expose the filepath as a named export","directories":{},"sideEffects":false,"_nodeVersion":"20.11.0","dependencies":{"unified":"^11.0.0","@types/estree":"^1.0.0","normalize-path":"^3.0.0","estree-util-is-identifier-name":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^8.0.0","acorn":"^8.0.0","eslint":"^8.0.0","astring":"^1.0.0","prettier":"^3.0.0","remark-cli":"^11.0.0","source-map":"^0.7.0","typescript":"^5.0.0","eslint-plugin-react":"^7.0.0","@types/normalize-path":"^3.0.0","eslint-plugin-jsx-a11y":"^6.0.0","eslint-config-remcohaszing":"^10.0.0","remark-preset-remcohaszing":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/recma-export-filepath_1.1.0_1707584591188_0.3545074889938673","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"recma-export-filepath","version":"1.2.0","description":"A recma plugin to expose the filepath as a named export","keywords":["estree","mdx","recma","unified"],"homepage":"https://github.com/remcohaszing/recma-export-filepath#readme","bugs":{"url":"https://github.com/remcohaszing/recma-export-filepath/issues"},"repository":{"type":"git","url":"git+https://github.com/remcohaszing/recma-export-filepath.git"},"funding":"https://github.com/sponsors/remcohaszing","license":"MIT","author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"sideEffects":false,"type":"module","exports":"./dist/recma-export-filepath.js","main":"./dist/recma-export-filepath.js","scripts":{"prepack":"tsc --build","pretest":"tsc --build","test":"c8 node --test"},"dependencies":{"@types/estree":"^1.0.0","estree-util-is-identifier-name":"^3.0.0","normalize-path":"^3.0.0","unified":"^11.0.0","unist-util-mdx-define":"^1.0.0"},"devDependencies":{"@types/normalize-path":"^3.0.0","c8":"^10.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","prettier":"^3.0.0","recma":"^1.0.0","remark-cli":"^12.0.0","remark-preset-remcohaszing":"^3.0.0","source-map":"^0.7.0","typescript":"^5.0.0"},"_id":"recma-export-filepath@1.2.0","types":"./dist/recma-export-filepath.d.ts","_integrity":"sha512-tsaQbFU5Opw5Q8YOgyvrX8cTe5U94vx9D3GvKYxJSoBjhrziX4seaB6qzHJeAhMbtDBUP9lM6Pz/JrG3a43hKQ==","_resolved":"/home/runner/work/recma-export-filepath/recma-export-filepath/recma-export-filepath-1.2.0.tgz","_from":"file:recma-export-filepath-1.2.0.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-tsaQbFU5Opw5Q8YOgyvrX8cTe5U94vx9D3GvKYxJSoBjhrziX4seaB6qzHJeAhMbtDBUP9lM6Pz/JrG3a43hKQ==","shasum":"2b42e39dc9463b59d9ea24c154971567cd0c4da6","tarball":"https://registry.npmjs.org/recma-export-filepath/-/recma-export-filepath-1.2.0.tgz","fileCount":8,"unpackedSize":9514,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/recma-export-filepath@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAJsUzPkg2I1X1Df0RJj8Nho3YbHZrMh1o94z664I0nBAiEAyPZ23d+xZFQ9k25g/3Na5mvqh+J7zMFmnBenSK4x2zE="}]},"_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-export-filepath_1.2.0_1742760512644_0.06536528531515806"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-12T13:11:51.145Z","modified":"2025-03-23T20:08:33.380Z","1.0.0":"2023-10-12T13:11:51.459Z","1.1.0":"2024-02-10T17:03:11.391Z","1.2.0":"2025-03-23T20:08:32.926Z"},"bugs":{"url":"https://github.com/remcohaszing/recma-export-filepath/issues"},"author":{"name":"Remco Haszing","email":"remcohaszing@gmail.com"},"license":"MIT","homepage":"https://github.com/remcohaszing/recma-export-filepath#readme","keywords":["estree","mdx","recma","unified"],"repository":{"type":"git","url":"git+https://github.com/remcohaszing/recma-export-filepath.git"},"description":"A recma plugin to expose the filepath as a named export","maintainers":[{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"readme":"# recma-export-filepath\n\n[![github actions](https://github.com/remcohaszing/recma-export-filepath/actions/workflows/ci.yaml/badge.svg)](https://github.com/remcohaszing/recma-export-filepath/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/remcohaszing/recma-export-filepath/branch/main/graph/badge.svg)](https://codecov.io/gh/remcohaszing/recma-export-filepath)\n[![npm version](https://img.shields.io/npm/v/recma-export-filepath)](https://www.npmjs.com/package/recma-export-filepath)\n[![npm downloads](https://img.shields.io/npm/dm/recma-export-filepath)](https://www.npmjs.com/package/recma-export-filepath)\n\nA recma plugin to expose the filepath as a named export.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [Options](#options)\n- [Compatibility](#compatibility)\n- [License](#license)\n\n## Installation\n\n```sh\nnpm install recma-export-filepath\n```\n\n## Usage\n\nThis recma plugin exposes the filepath of the current file as a named export.\n\nFor example, given a file named `example.mdx` with the following contents:\n\n```mdx\nHello 👋\n```\n\nThe following script:\n\n```js\nimport { compile } from '@mdx-js/mdx'\nimport recmaExportFilepath from 'recma-export-filepath'\nimport { read } from 'to-vfile'\n\nconst { contents } = await compile(await read('example.mdx'), {\n  jsx: true,\n  recmaPlugins: [recmaExportFilepath]\n})\n\nconsole.log(contents)\n```\n\nRoughly yields:\n\n```jsx\nexport const filepath = 'example.mdx'\n\nexport default function MDXContent() {\n  return <p>Hello 👋</p>\n}\n```\n\n## API\n\nThe default export is a recma plugin.\n\n### Options\n\n- `absolute` (`boolean`, default: `false`) — If true, use an absolute path. By default a relative\n  path is used.\n- `cwd` (`string`) The current working directory to use when generating a relative file path.\n- `name` (`string`, default: `'filepath'`) — The name to export the file path as.\n\nIn addition it supports `unist-util-mdx-define`\n[options](https://github.com/remcohaszing/unist-util-mdx-define#options).\n\n## Compatibility\n\nThis project is compatible with Node.js 16 or greater.\n\n## License\n\n[MIT](LICENSE.md) © [Remco Haszing](https://github.com/remcohaszing)\n","readmeFilename":"README.md"}