{"_id":"@beautinique/shared-markdown-to-html","_rev":"5-33a5256b0417108a2d742d342b181445","name":"@beautinique/shared-markdown-to-html","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@beautinique/shared-markdown-to-html","version":"1.0.0","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/shared-markdown-to-html@1.0.0","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"cd6cd78cbf9e2c38a54b3bc77dc26d2ca7ad6aa8","tarball":"https://registry.npmjs.org/@beautinique/shared-markdown-to-html/-/shared-markdown-to-html-1.0.0.tgz","fileCount":22,"integrity":"sha512-+HgiDzazUQxDPf7Hqw2buMZRH+KU7E7EqaZDz7wvn5sAw8wlYlDKhCXNB+RI33BEssg/1HhpCe2xVOAYMpe/LA==","signatures":[{"sig":"MEQCIFAzaUjt0NQuxUmAxcRF9S1D1Z/sUIf/y9KFYzSGptw+AiAM3QBhWXoSesZzUJzOLoFBEB/4GnBSCgMvAne1SSuwtQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34613},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"16220552d27e9bf2ae5fd0943407497aef1690af","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/shared/markdown-to-html"},"_npmVersion":"11.8.0","description":"Shared Markdown file to HTML file generation for Beautinique.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"marked":"^18.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/shared-markdown-to-html_1.0.0_1783970965536_0.1991455884865505","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@beautinique/shared-markdown-to-html","version":"1.0.1","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/shared-markdown-to-html@1.0.1","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"f6d7830a14f34403df6e9c69687a8f5742e124f8","tarball":"https://registry.npmjs.org/@beautinique/shared-markdown-to-html/-/shared-markdown-to-html-1.0.1.tgz","fileCount":22,"integrity":"sha512-VWJi2FRKKYyDObowjVlzcc4P4Fd6xdY4oWeOXpkqlG0etJv5IcJGUpRtkuTkLMnvAIv0nnBJCdo4VvEJsmtzSw==","signatures":[{"sig":"MEUCIHsZuWIyR4ocGlQ1a0XoButklsILDCm+jAKzEW0AGQXSAiEA5Pd7hYWY7WBkCoxKB15ZStOQEYXO7IIxyKMdODXp46g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34613},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"e30737149d6d3916e61a909d2a30954882a1ce7e","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/shared/markdown-to-html"},"_npmVersion":"11.8.0","description":"Shared Markdown file to HTML file generation for Beautinique.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"marked":"^18.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/shared-markdown-to-html_1.0.1_1785442952375_0.22883444728582214","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@beautinique/shared-markdown-to-html","version":"1.0.2","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/shared-markdown-to-html@1.0.2","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"dd71ad50de3c67ed95e7aeff6dd6459c70d698e4","tarball":"https://registry.npmjs.org/@beautinique/shared-markdown-to-html/-/shared-markdown-to-html-1.0.2.tgz","fileCount":22,"integrity":"sha512-MjuPRkNwhY5tvp2KijU5KX3OfVLqZZxltWA37DU1zrwgbUVhNPtM5IV3uBocDIJi8KnAzhLvLDt7pGJP7SWQsw==","signatures":[{"sig":"MEYCIQDJQSyr/UTfXc+HnYDIhyg7QSfqxNtt+kNIwXIhqJMoxQIhAJtKkp2mC2YFF/T+KOaboD4s1pWhpHtXtYkHlym3ybSQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35313},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"b026a3b9693c94e58dcd163010dbf39b6b79e7ea","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/shared/markdown-to-html"},"_npmVersion":"11.8.0","description":"Shared Markdown file to HTML file generation for Beautinique.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"marked":"^18.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/shared-markdown-to-html_1.0.2_1787039424240_0.3436618963796454","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@beautinique/shared-markdown-to-html","version":"1.0.3","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","_id":"@beautinique/shared-markdown-to-html@1.0.3","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"dist":{"shasum":"64c2ea61a170f0d7b3a63de0d71fc135fc7b89a3","tarball":"https://registry.npmjs.org/@beautinique/shared-markdown-to-html/-/shared-markdown-to-html-1.0.3.tgz","fileCount":22,"integrity":"sha512-W1ENpY337Uv+NVLxMhRDHVZcCsuVmGodSjsDGJFgcCqsaOJ4VUQHDxcoR2TKFuzCCDhiEiOSpgDHLiIy2yTZSg==","signatures":[{"sig":"MEUCIAhYefEgrxn0NBZnSUUbEXfuCBiZIvQZOmZMLz/FxUwAAiEAw4xrdeYB9Oj0bIO2NpTqBRGVfMXQYOvFe1N+knPi1mU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35313},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"gitHead":"2807c53a8d389b6f0a36770b416bcc2026e40ca2","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"repository":{"url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","type":"git","directory":"packages/shared/markdown-to-html"},"_npmVersion":"11.10.1","description":"Shared Markdown file to HTML file generation for Beautinique.","directories":{},"sideEffects":false,"_nodeVersion":"24.13.1","dependencies":{"marked":"^18.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/shared-markdown-to-html_1.0.3_1787219520769_0.9929842971344089","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@beautinique/shared-markdown-to-html","version":"1.0.4","description":"Shared Markdown file to HTML file generation for Beautinique.","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"author":{"name":"Nageshwar Pawar"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/shared/markdown-to-html"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"tsup","postbuild":"node ../../../scripts/build-types/index.mjs","dev":"tsup --watch","lint":"eslint .","typecheck":"tsc --noEmit"},"publishConfig":{"access":"public"},"engines":{"node":">=24"},"devDependencies":{"typescript":"^6.0.3"},"dependencies":{"marked":"^18.0.6"},"gitHead":"3a5103fb9030969e849b1e69b02bbe7d1cab5fbe","_id":"@beautinique/shared-markdown-to-html@1.0.4","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-1EXnpGbDI9Q9gRzY4TF6XcuseFKQMSC8BGS1WyHKrF6k+Ur5BVF96+3EZuJoypqKvhtkfdt+ZuhLHi6ZwllBjw==","shasum":"b0c4296ec30eee251980f1b3eae2dbc18682c4d7","tarball":"https://registry.npmjs.org/@beautinique/shared-markdown-to-html/-/shared-markdown-to-html-1.0.4.tgz","fileCount":22,"unpackedSize":35313,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGR9FJT5eUcJcV74NTAoR5gvG1G2DmHw4M7RJqiQqO9NAiBPySLzNGB1RkD/J2JrW9a6iUpLAADstHRUHfFjuUfyUw=="}]},"_npmUser":{"name":"beautinique","email":"beautinique.bq@gmail.com"},"directories":{},"maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shared-markdown-to-html_1.0.4_1787576814578_0.9078638867320108"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-13T19:29:25.360Z","modified":"2026-08-24T13:06:54.887Z","1.0.0":"2026-07-13T19:29:25.687Z","1.0.1":"2026-07-30T20:22:32.509Z","1.0.2":"2026-08-18T07:50:24.393Z","1.0.3":"2026-08-20T09:52:00.930Z","1.0.4":"2026-08-24T13:06:54.729Z"},"bugs":{"url":"https://github.com/Nageshwar1997/BQ-Packages/issues"},"author":{"name":"Nageshwar Pawar"},"license":"MIT","homepage":"https://github.com/Nageshwar1997/BQ-Packages/tree/main/packages/shared/markdown-to-html#readme","keywords":["beautinique","html","markdown","readme","shared","beautinique"],"repository":{"type":"git","url":"git+https://github.com/Nageshwar1997/BQ-Packages.git","directory":"packages/shared/markdown-to-html"},"description":"Shared Markdown file to HTML file generation for Beautinique.","maintainers":[{"name":"beautinique","email":"beautinique.bq@gmail.com"}],"readme":"# @beautinique/shared-markdown-to-html\r\n\r\nRenders a Markdown file (typically a service's own `README.md`) into a single, self-contained, GitHub-styled HTML page (light/dark aware, no external requests) at build time.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @beautinique/shared-markdown-to-html\r\n```\r\n\r\n## Usage\r\n\r\nCall `generateHtmlFromMarkdown` from a small build-time script in the consuming service, and wire that script into the service's own `postbuild` (or `predev`) npm script - not into request-handling code. This way the HTML is generated once, at build time, and the server just serves the static file on every request instead of re-parsing Markdown per request:\r\n\r\n```js\r\n// scripts/generate-html.mjs\r\nimport { generateHtmlFromMarkdown } from '@beautinique/shared-markdown-to-html';\r\n\r\ngenerateHtmlFromMarkdown({\r\n  markdownPath: 'README.md', // default\r\n  outputPath: 'public/index.html', // default\r\n  title: 'Media Service', // required - no sensible default across services\r\n});\r\n```\r\n\r\n```json\r\n// package.json\r\n{\r\n  \"scripts\": {\r\n    \"build\": \"tsc\",\r\n    \"postbuild\": \"node scripts/generate-html.mjs\"\r\n  }\r\n}\r\n```\r\n\r\nThen in the server:\r\n\r\n```ts\r\napp.get('/', (_req, res) => {\r\n  res.sendFile(path.resolve('public/index.html'));\r\n});\r\n```\r\n\r\n| Option        | Default             | Description                                                                 |\r\n| ------------- | -------------------- | ------------------------------------------------------------------------------ |\r\n| `markdownPath` | `'README.md'`         | Path to the source Markdown file, resolved against `cwd`.                     |\r\n| `outputPath`   | `'public/index.html'` | Path to write the generated HTML file to - parent directories are created if missing, resolved against `cwd`. |\r\n| `title`        | _(required)_          | `<title>` of the generated page - no sensible default shared across services. |\r\n| `lang`         | `'en'`                | `<html lang=\"...\">`.                                                          |\r\n| `extraStyles`  | `undefined`           | Extra CSS appended after the built-in page styles (e.g. to override a color or add branding). |\r\n| `cwd`          | `process.cwd()`       | Directory both paths above are resolved against.                             |\r\n\r\n## Using this in a frontend (Vite/React) app\r\n\r\nThis package itself only ever runs in Node.js (it reads/writes files via `node:fs`) - never import `generateHtmlFromMarkdown` into browser-bundled source (anything under `src/` that Vite ships to the client). Wire it into the app's own build-time scripts instead, exactly like a backend service:\r\n\r\n```js\r\n// scripts/generate-html.mjs\r\nimport { generateHtmlFromMarkdown } from '@beautinique/shared-markdown-to-html';\r\n\r\ngenerateHtmlFromMarkdown({\r\n  markdownPath: 'README.md',\r\n  outputPath: 'public/docs.html', // see warning below - don't use 'public/index.html'\r\n  title: 'My App Docs',\r\n});\r\n```\r\n\r\n```json\r\n// package.json\r\n{\r\n  \"scripts\": {\r\n    \"predev\": \"node scripts/generate-html.mjs\",\r\n    \"dev\": \"vite\",\r\n    \"build\": \"vite build\",\r\n    \"postbuild\": \"node scripts/generate-html.mjs\"\r\n  }\r\n}\r\n```\r\n\r\nAnything inside Vite's `public/` directory is served as-is, unprocessed, at the matching URL path - in both `vite dev` and after `vite build`. So once `public/docs.html` exists, it's reachable at `/docs.html`, and can be shown inside the app with a plain `iframe` - no need to import this package (or touch `node:fs`) from any browser code at all:\r\n\r\n```tsx\r\nfunction DocsPage() {\r\n  return <iframe src=\"/docs.html\" title=\"Docs\" style={{ width: '100%', height: '100vh', border: 'none' }} />;\r\n}\r\n```\r\n\r\n**Don't set `outputPath` to `public/index.html`** in a Vite app - Vite's own SPA entry point is an `index.html` (conventionally at the project root, sometimes copied into `public/`), containing the `<script type=\"module\">` tag that boots the app. Overwriting it with this package's rendered Markdown page would break the app entirely. Pick a distinct filename (`public/docs.html`, `public/readme.html`, etc.) instead.\r\n\r\n## Repository\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Homepage\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages\r\n\r\n## Issues\r\n\r\nhttps://github.com/Nageshwar1997/BQ-Packages/issues\r\n\r\n## Author\r\n\r\nNageshwar Pawar\r\n\r\n## License\r\n\r\nThis package is licensed under the MIT License. See the root `LICENSE` file for details.\r\n","readmeFilename":"README.md"}