{"_id":"@brandonhimpfen/markdown-extensions","_rev":"2-264c6d2480c02f84fd3d18a963d5d33c","name":"@brandonhimpfen/markdown-extensions","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@brandonhimpfen/markdown-extensions","version":"1.0.0","license":"MIT","_id":"@brandonhimpfen/markdown-extensions@1.0.0","maintainers":[{"name":"brandonhimpfen","email":"brandon@himpfen.com"}],"dist":{"shasum":"99f165fb61d4442dde563fe502ee798a7f2b2db4","tarball":"https://registry.npmjs.org/@brandonhimpfen/markdown-extensions/-/markdown-extensions-1.0.0.tgz","fileCount":6,"integrity":"sha512-XzDlOTsxQm5JTc+o42nXupLDgnzgKMfeHR0x4Vtpm7kmN4o7gzT3/PMu/8IsbAGuWBrfaAnu3+53IQMv2mQkdQ==","signatures":[{"sig":"MEQCIF5RrpJEGkv/HsTHtcNwvzQRsWXmGirldJSh3ZXUZ7GLAiAx3CbicuSLL+ED1KOL8MmPcIgtu+SYpzL7UOQIZELmVg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6902},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"gitHead":"f649c37d2d7625b293c8855555153c0624a9ce19","_npmUser":{"name":"brandonhimpfen","email":"brandon@himpfen.com"},"_npmVersion":"11.11.0","description":"List of Markdown file extensions with small utilities","directories":{},"_nodeVersion":"25.8.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/markdown-extensions_1.0.0_1774143465423_0.9728303450595472","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@brandonhimpfen/markdown-extensions","version":"1.0.1","description":"List of Markdown file extensions with small utilities","license":"MIT","type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/brandonhimpfen/markdown-extensions.git"},"homepage":"https://github.com/brandonhimpfen/markdown-extensions#readme","bugs":{"url":"https://github.com/brandonhimpfen/markdown-extensions/issues"},"gitHead":"5d083c22ef7290741a39a9c1b285a51f28c24f98","types":"./index.d.ts","_id":"@brandonhimpfen/markdown-extensions@1.0.1","_nodeVersion":"25.8.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-VkSQ4t9C65nCB8byA74DX2QYGXqS/KDm0X8i7wb7hD91cPqsBYxXwmCZdPVyGvAnW5w4AzKR46Iq8B+hHN5sGA==","shasum":"d8eb88110144aa8389f8b02462aa75f90dc5b68c","tarball":"https://registry.npmjs.org/@brandonhimpfen/markdown-extensions/-/markdown-extensions-1.0.1.tgz","fileCount":6,"unpackedSize":7431,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD23IY7agasc8SjA8tRj4TAdvlFqqHPWft85zl5hOWupgIgW6zbCUXfGc/Thyv9vrMaE/2YLMA6sJNoXdT1fR8bErY="}]},"_npmUser":{"name":"brandonhimpfen","email":"brandon@himpfen.com"},"directories":{},"maintainers":[{"name":"brandonhimpfen","email":"brandon@himpfen.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdown-extensions_1.0.1_1774143836130_0.34669460736146074"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-22T01:37:45.354Z","modified":"2026-03-22T01:43:56.389Z","1.0.0":"2026-03-22T01:37:45.588Z","1.0.1":"2026-03-22T01:43:56.274Z"},"license":"MIT","description":"List of Markdown file extensions with small utilities","maintainers":[{"name":"brandonhimpfen","email":"brandon@himpfen.com"}],"readme":"# markdown-extensions\n\n[![npm version](https://img.shields.io/npm/v/@brandonhimpfen/markdown-extensions.svg)](https://www.npmjs.com/package/@brandonhimpfen/markdown-extensions)\n[![license](https://img.shields.io/npm/l/@brandonhimpfen/markdown-extensions.svg)](LICENSE)\n\nA small, reliable utility that provides a canonical list of Markdown file extensions along with helper functions for detecting and working with them.\n\nDesigned to be lightweight, predictable, and useful in real-world tooling such as static site generators, content pipelines, and repository automation.\n\n## ✨ Features\n\n- Canonical list of Markdown extensions.\n- Single source of truth (JSON-driven).\n- Helper utilities for real-world usage.\n- Handles edge cases like:\n  - `.md`\n  - `MD`\n  - `README.markdown`\n  - file paths (`/docs/file.mkd`)\n- Zero dependencies.\n- Tiny footprint.\n\n## 📦 Install\n\n```bash\nnpm install @brandonhimpfen/markdown-extensions\n```\n\n## 🚀 Usage\n\n### Import\n\n```js\nimport markdownExtensions, {\n  isMarkdownExtension,\n  isMarkdownFile,\n  normalizeExtension\n} from '@brandonhimpfen/markdown-extensions';\n```\n\n### Get all Markdown extensions\n\n```js\nconsole.log(markdownExtensions);\n//=> ['md', 'markdown', 'mdown', 'mkdn', 'mkd', 'mdwn', 'mkdown', 'ron', 'ronn']\n```\n\n### Check if a value is a Markdown extension\n\n```js\nisMarkdownExtension('md');        // true\nisMarkdownExtension('.md');       // true\nisMarkdownExtension('.MD');       // true\nisMarkdownExtension('markdown');  // true\nisMarkdownExtension('txt');       // false\n```\n\n### Check if a file is a Markdown file\n\n```js\nisMarkdownFile('README.md');            // true\nisMarkdownFile('docs/guide.markdown');  // true\nisMarkdownFile('notes.txt');            // false\nisMarkdownFile('README');               // false\n```\n\n### Normalize extensions\n\n```js\nnormalizeExtension('.MD');               // 'md'\nnormalizeExtension('README.markdown');   // 'markdown'\nnormalizeExtension('/docs/file.MKD');    // 'mkd'\n```\n\n## 🧠 How It Works\n\n- All extensions are stored in `extensions.json`.\n- The runtime imports and freezes this list.\n- A `Set` is used for fast lookups.\n- Inputs are normalized before comparison.\n\nThis ensures consistency, correctness and no duplication bugs.\n\n## 📌 Notes\n\n- Extensions are stored **without leading dots**.\n- Helpers accept:\n  - extensions (`md`)\n  - dot-prefixed extensions (`.md`)\n  - filenames (`README.md`)\n  - file paths (`/docs/file.md`)\n- Files without extensions (e.g. `README`) are **not** considered Markdown files.\n\n## 🤔 Why include `ron` and `ronn`?\n\nThese extensions are historically associated with Markdown tooling, particularly manual page generators and documentation systems. They are included for completeness and compatibility.\n\n## 🔧 Use Cases\n\nThis package is especially useful for:\n\n- Static site generators.\n- Content ingestion pipelines.\n- Markdown parsers and converters.\n- GitHub Actions and repo automation.\n- CLI tools that process files.\n- AI / search indexing pipelines.\n\n## 🧪 Example: filtering Markdown files\n\n```js\nimport { isMarkdownFile } from 'markdown-extensions';\n\nconst files = ['README.md', 'index.js', 'guide.markdown'];\n\nconst markdownFiles = files.filter(isMarkdownFile);\n\nconsole.log(markdownFiles);\n//=> ['README.md', 'guide.markdown']\n```\n\n## 🧾 API\n\n### `markdownExtensions`\n\nType: `readonly string[]`\n\nList of known Markdown file extensions (without leading dots).\n\n### `markdownExtensionsSet`\n\nType: `ReadonlySet<string>`\n\nA `Set` version of the extensions for fast lookups.\n\n### `normalizeExtension(input)`\n\nNormalize an extension or filename.\n\nReturns a lowercase extension without a leading dot.\n\n### `isMarkdownExtension(input)`\n\nReturns `true` if the input represents a Markdown extension.\n\n### `isMarkdownFile(input)`\n\nReturns `true` if the input represents a Markdown filename.\n\n## 🧩 Design Philosophy\n\nThis package is intentionally:\n\n- Small\n- Predictable\n- Dependency-free\n- Focused on correctness\n\nIt aims to be a simple building block in larger systems rather than a full parsing solution.\n\n## 📄 License\n\nMIT\n","readmeFilename":"README.md","homepage":"https://github.com/brandonhimpfen/markdown-extensions#readme","repository":{"type":"git","url":"git+https://github.com/brandonhimpfen/markdown-extensions.git"},"bugs":{"url":"https://github.com/brandonhimpfen/markdown-extensions/issues"}}