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

synxdown

v1.0.0

Published

A lightweight syntax highlighting package for markdown and HTML tags

Downloads

6

Readme

Synxdown

A lightweight syntax highlighting package for markdown and HTML tags. Perfect for adding color-coded syntax highlighting to your applications without heavy dependencies.

Features

  • 🎨 Syntax highlighting for HTML and Markdown
  • 🔍 Auto-detection of content type
  • 🎯 Lightweight and fast
  • 🛠️ Customizable colors and themes
  • 📱 Works in both browser and Node.js
  • 💫 Zero dependencies

Installation

npm install synxdown

Quick Start

const Synxdown = require("synxdown");

// Create a highlighter instance
const highlighter = new Synxdown();

// Highlight HTML
const htmlCode = '<div class="container"><h1>Hello</h1></div>';
console.log(highlighter.highlightHTML(htmlCode));

// Highlight Markdown
const markdownCode = "# Header\n**Bold text** and *italic text*";
console.log(highlighter.highlightMarkdown(markdownCode));

// Auto-detect and highlight
console.log(highlighter.highlight("<p>This is HTML</p>"));
console.log(highlighter.highlight("# This is Markdown"));

API Reference

Constructor

const highlighter = new Synxdown(options);

Options

{
  colors: {
    // HTML colors
    htmlTag: '#e06c75',
    htmlAttr: '#d19a66',
    htmlString: '#98c379',
    htmlComment: '#5c6370',

    // Markdown colors
    mdHeader: '#61afef',
    mdBold: '#c678dd',
    mdItalic: '#e5c07b',
    mdCode: '#56b6c2',
    mdLink: '#61afef',
    mdQuote: '#5c6370',

    // General
    text: '#abb2bf'
  },
  theme: 'dark' // 'dark' or 'light'
}

Methods

highlightHTML(html)

Highlights HTML syntax with color spans.

const highlighted = highlighter.highlightHTML("<div>Hello</div>");

highlightMarkdown(markdown)

Highlights Markdown syntax with color spans.

const highlighted = highlighter.highlightMarkdown("# Hello **World**");

highlight(content, type)

Auto-detects content type and highlights accordingly.

const highlighted = highlighter.highlight(content); // auto-detect
const highlighted = highlighter.highlight(content, "html"); // force HTML
const highlighted = highlighter.highlight(content, "markdown"); // force Markdown

generateCSS(selector)

Generates CSS for styling highlighted content.

const css = highlighter.generateCSS(".my-code-block");

Static Methods

For quick one-off highlighting without creating an instance:

// Static methods
Synxdown.highlightHTML(html, options);
Synxdown.highlightMarkdown(markdown, options);
Synxdown.highlight(content, type, options);

Usage Examples

Basic HTML Highlighting

const Synxdown = require("synxdown");

const htmlCode = `
<div class="container" id="main">
  <h1>Welcome</h1>
  <!-- Comment here -->
  <p style="color: red;">Hello <strong>World</strong></p>
</div>`;

const highlighted = Synxdown.highlightHTML(htmlCode);
console.log(highlighted);

Basic Markdown Highlighting

const markdownCode = `
# Main Title
## Subtitle

This is **bold** and this is *italic*.
Here's some \`inline code\` and a [link](https://example.com).

> Blockquote here

\`\`\`javascript
const hello = "world";
\`\`\`
`;

const highlighted = Synxdown.highlightMarkdown(markdownCode);
console.log(highlighted);

Custom Colors

const highlighter = new Synxdown({
  colors: {
    htmlTag: "#ff6b6b",
    mdHeader: "#4ecdc4",
    mdBold: "#45b7d1",
  },
});

const highlighted = highlighter.highlight("# Custom **Colors**");

Browser Usage

<!DOCTYPE html>
<html>
  <head>
    <style id="synxdown-css"></style>
  </head>
  <body>
    <div id="code-block" class="synxdown"></div>

    <script src="path/to/synxdown.js"></script>
    <script>
      const highlighter = new Synxdown();

      // Inject CSS
      document.getElementById("synxdown-css").textContent =
        highlighter.generateCSS();

      // Highlight code
      const code = "<div>Hello World</div>";
      document.getElementById("code-block").innerHTML =
        highlighter.highlightHTML(code);
    </script>
  </body>
</html>

Supported Syntax

HTML

  • Tags with attributes
  • Self-closing tags
  • Comments
  • Attribute values (quoted strings)

Markdown

  • Headers (# ## ###)
  • Bold (text or text)
  • Italic (text or text)
  • Inline code (code)
  • Links (text)
  • Blockquotes (> text)
  • Code blocks (code)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details.

Changelog

v1.0.0

  • Initial release
  • HTML syntax highlighting
  • Markdown syntax highlighting
  • Auto-detection
  • Customizable colors
  • CSS generation