npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nakobase/nakobase-md-html

v2.3.1

Published

Convert Markdown to **sanitized HTML** and apply consistent styles – simple, secure, and styled.

Readme

@nakobase/nakobase-md-html

Convert Markdown to sanitized HTML and apply consistent styles – simple, secure, and styled.

Installation

# npm
npm install @nakobase/nakobase-md-html

# yarn
yarn add @nakobase/nakobase-md-html

# pnpm
pnpm add @nakobase/nakobase-md-html

Usage

Basic Usage

import { mdToHtml } from '@nakobase/nakobase-md-html';

const html = mdToHtml(
  `
# Hello World

This is a test of the markdown to html converter.
`,
  {
    codeHighlight: true,  // Enable code highlighting (optional, default is false)
    rich: true,           // Enable rich features like containers and custom blocks (optional, default is false)
    anchor: true,         // Enable anchor links (optional, default is false)
  }
);

console.log(html);

Add .nbcontent to the container of the markdown.

<div class="nbcontent">
  <!-- HTML parsed from markdown -->
</div>

Styles

We have some default styles that are applied to the HTML. All CSS variables use the --nb- prefix so they do not conflict with your app's design tokens (e.g. --background, --primary).

Import

Basic (markdown only):

import '@nakobase/nakobase-md-html/styles/base.css';

Rich (custom blocks, containers, etc.):

import '@nakobase/nakobase-md-html/styles/base.css';
import '@nakobase/nakobase-md-html/styles/rich.css';

Changing colors

You can customize colors in two ways:

  1. Content area (the .nbcontent block itself) The library does not set background-color or color on .nbcontent, so it inherits from its parent (e.g. your page background and text color). To give it its own look, set them directly:

    .nbcontent {
      background-color: #f8f8f8;
      color: #333;
    }
  2. Inner elements (code blocks, containers, links, etc.) Override CSS variables on .nbcontent. Variables are prefixed with --nb- (e.g. --nb-primary, --nb-link, --nb-background for inner boxes). See base styles for the full list.

    .nbcontent {
      --nb-primary: #2563eb;
      --nb-link: #0ea5e9;
    }

    If your overrides (e.g. in globals.css) don't take effect because the library CSS loads later, either load your override CSS after the library (e.g. import it after base.css / rich.css in the page that renders the content), or use !important (e.g. --nb-link: #000 !important;).

You can use both: e.g. set .nbcontent { background-color; color; } for the content area and --nb-* for code blocks and containers.

Code Highlighting

If you want code highlighting, also import a Prism theme:

import 'prismjs/themes/prism-okaidia.css'; // or any other prism theme