{"id":20065,"library":"github-markdown-html","title":"github-markdown-html","description":"Markdown to HTML converter that uses webpack to process markdown files, highlight code blocks, and embed GitHub-like styles via github-markdown-css. Version 4.1.0 is stable with a low release cadence. It distinguishes itself by bundling all transformation steps into a single webpack pipeline, making it easy to generate a styled HTML page from a README.md with a single command.","status":"active","version":"4.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/csabapalfi/github-markdown-html","tags":["javascript","github","markdown","webpack"],"install":[{"cmd":"npm install github-markdown-html","lang":"bash","label":"npm"},{"cmd":"yarn add github-markdown-html","lang":"bash","label":"yarn"},{"cmd":"pnpm add github-markdown-html","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core build tool used for bundling the markdown-to-HTML pipeline","package":"webpack","optional":false},{"reason":"Webpack loader for converting markdown to HTML","package":"markdown-loader","optional":false},{"reason":"Webpack loader for syntax highlighting code blocks","package":"highlight-loader","optional":false},{"reason":"Webpack plugin for generating the HTML template","package":"html-webpack-plugin","optional":false},{"reason":"Provides GitHub-like styles for the rendered HTML","package":"github-markdown-css","optional":false},{"reason":"Removes unused CSS rules from the embedded styles","package":"html-webpack-uncss-plugin","optional":true}],"imports":[{"note":"Package exports a single function via default export. CommonJS require is also supported.","wrong":"const githubMarkdownHtml = require('github-markdown-html')","symbol":"main","correct":"import githubMarkdownHtml from 'github-markdown-html'"},{"note":"Named export 'build' is available for programmatic usage starting from v4.","wrong":"","symbol":"build","correct":"import { build } from 'github-markdown-html'"},{"note":"Named export 'dev' is available for starting the dev server programmatically.","wrong":"","symbol":"dev","correct":"import { dev } from 'github-markdown-html'"},{"note":"Default import is the simplest way – no need to destructure 'default'.","wrong":"import { default as githubMarkdownHtml } from 'github-markdown-html'","symbol":"default","correct":"import githubMarkdownHtml from 'github-markdown-html'"}],"quickstart":{"code":"// Install globally\nnpm install -g github-markdown-html\n\n// Navigate to a directory with a README.md and run:\ngithub-markdown-html build\n\n// This creates an index.html with GitHub-styled markdown.\n\n// For programmatic usage:\nimport githubMarkdownHtml from 'github-markdown-html';\nimport { build } from 'github-markdown-html';\n\n// Or in CommonJS:\nconst githubMarkdownHtml = require('github-markdown-html');\nconst { build } = require('github-markdown-html');","lang":"typescript","description":"Shows both CLI usage (build command) and programmatic import with named exports."},"warnings":[{"fix":"Install globally with npm install -g github-markdown-html or use npx github-markdown-html build.","message":"Running the CLI command without installing globally may fail if the package is not in PATH.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Consider alternatives like marked with highlight.js or a custom webpack setup.","message":"The package is low-maintenance and may rely on older webpack versions.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Update imports: use import { build } from 'github-markdown-html' instead of require('github-markdown-html').build().","message":"Version 4.0.0 introduced named exports (build, dev) and changed the default export behavior.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure a README.md exists in the working directory before running the command.","message":"The CLI expects a README.md in the current directory; if not present, the build fails silently.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use a separate output directory or version control to preserve custom HTML files.","message":"The generated index.html is overwritten without warning; custom changes will be lost.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Customize styles with your own CSS file or replace github-markdown-css with a more recent alternative.","message":"github-markdown-css is used but may not be kept up-to-date with GitHub's latest styles.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Disable the plugin or configure it to whitelist necessary classes if dynamic content is missing styles.","message":"The html-webpack-uncss-plugin may remove CSS that is dynamically added by JavaScript; test carefully.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install github-markdown-html or install globally with npm install -g github-markdown-html.","cause":"Package is not installed or not in the current project's node_modules.","error":"Error: Cannot find module 'github-markdown-html'"},{"fix":"Install globally: npm install -g github-markdown-html, or use npx: npx github-markdown-html build.","cause":"CLI binary is not in PATH (global install issue or not installed globally).","error":"github-markdown-html: command not found"},{"fix":"Use named imports: import { build } from 'github-markdown-html'; then call build().","cause":"Default import is used incorrectly; the package exports an object with methods, not a direct function.","error":"TypeError: githubMarkdownHtml is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}