Registry / serialization / github-markdown-html

github-markdown-html

JSON →
library4.1.0jsnpmunverified

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.

npm install github-markdown-html
INSTALL
IMPORT
SIG · GITHUB-MARKDOWN-HT
G
github-markdown-html
serializationjavascriptv4.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
import githubMarkdownHtml from 'github-markdown-html'
const githubMarkdownHtml = require('github-markdown-html')
Package exports a single function via default export. CommonJS require is also supported.
build
import { build } from 'github-markdown-html'
Named export 'build' is available for programmatic usage starting from v4.
dev
import { dev } from 'github-markdown-html'
Named export 'dev' is available for starting the dev server programmatically.
default
import githubMarkdownHtml from 'github-markdown-html'
import { default as githubMarkdownHtml } from 'github-markdown-html'
Default import is the simplest way – no need to destructure 'default'.

Shows both CLI usage (build command) and programmatic import with named exports.

// Install globally npm install -g github-markdown-html // Navigate to a directory with a README.md and run: github-markdown-html build // This creates an index.html with GitHub-styled markdown. // For programmatic usage: import githubMarkdownHtml from 'github-markdown-html'; import { build } from 'github-markdown-html'; // Or in CommonJS: const githubMarkdownHtml = require('github-markdown-html'); const { build } = require('github-markdown-html');
github-markdown-html --version
Debug
Known issues
gotchaRunning the CLI command without installing globally may fail if the package is not in PATH.
fix
Install globally with npm install -g github-markdown-html or use npx github-markdown-html build.
affects: >=4.0.0
deprecatedThe package is low-maintenance and may rely on older webpack versions.
fix
Consider alternatives like marked with highlight.js or a custom webpack setup.
affects: >=4.0.0
breakingVersion 4.0.0 introduced named exports (build, dev) and changed the default export behavior.
fix
Update imports: use import { build } from 'github-markdown-html' instead of require('github-markdown-html').build().
affects: >=4.0.0
gotchaThe CLI expects a README.md in the current directory; if not present, the build fails silently.
fix
Ensure a README.md exists in the working directory before running the command.
affects: >=4.0.0
gotchaThe generated index.html is overwritten without warning; custom changes will be lost.
fix
Use a separate output directory or version control to preserve custom HTML files.
affects: >=4.0.0
deprecatedgithub-markdown-css is used but may not be kept up-to-date with GitHub's latest styles.
fix
Customize styles with your own CSS file or replace github-markdown-css with a more recent alternative.
affects: >=4.0.0
gotchaThe html-webpack-uncss-plugin may remove CSS that is dynamically added by JavaScript; test carefully.
fix
Disable the plugin or configure it to whitelist necessary classes if dynamic content is missing styles.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'github-markdown-html'
Package is not installed or not in the current project's node_modules.
fix
Run npm install github-markdown-html or install globally with npm install -g github-markdown-html.
github-markdown-html: command not found
CLI binary is not in PATH (global install issue or not installed globally).
fix
Install globally: npm install -g github-markdown-html, or use npx: npx github-markdown-html build.
TypeError: githubMarkdownHtml is not a function
Default import is used incorrectly; the package exports an object with methods, not a direct function.
fix
Use named imports: import { build } from 'github-markdown-html'; then call build().
Upgrade
Version history
4.1.0latest on npm
Audit
Dependencies
webpackrequiredCore build tool used for bundling the markdown-to-HTML pipeline
markdown-loaderrequiredWebpack loader for converting markdown to HTML
highlight-loaderrequiredWebpack loader for syntax highlighting code blocks
html-webpack-pluginrequiredWebpack plugin for generating the HTML template
github-markdown-cssrequiredProvides GitHub-like styles for the rendered HTML
html-webpack-uncss-pluginoptionalRemoves unused CSS rules from the embedded styles
Agent activity
10 hits · last 30 days
node
10
Resources
github-markdown-html — npm install github-markdown-html · libregistry