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 🙏

© 2025 – Pkg Stats / Ryan Hefner

kolmo-syntax

v1.1.1

Published

A syntax coloring lib for html texts divs, primarily for Kolmo Lang but extensible

Readme

Kolmo Syntax Highlighter

An elegant syntax highlighter for the Kolmo language, using TypeScript.

Features

  • Syntax highlighting for Kolmo language
  • Multiple theme options:
    • Catppuccin Frappé
    • One Dark
    • JetBrains Fleet
  • Support for:
    • Comments
    • Characters
    • Numbers
    • Constructors
    • Special symbols (λ, Π, ∀, etc.)
    • Operators
    • Declaration and definition keywords
    • Control flow and match structures
    • Delimiters and punctuation
    • Variables

How to Use

  1. Include the required files in your HTML:
<link rel="stylesheet" href="dist/kolmo.css">
<script src="dist/kolmo-syntax.js"></script>
  1. Add the kolmo-syntax class to the element containing Kolmo code:
<div class="kolmo-syntax">
    // Your Kolmo code here
</div>
  1. Initialize the highlighter with options:
<script>
    // Initialize with default theme (Frappé)
    init();

    // Or specifies a theme
    init({ theme: 'one-dark' });

    // You can also set it later
    setTheme('frappe');
</script>

Development

Prerequisites

  • Node.js
  • TypeScript

Installation

npm install

Scripts

  • npm run build - Compiles TypeScript and copies CSS files
  • npm run watch - Watches for changes in TypeScript files
  • npm run clean - Cleans the distribution folder

Project Structure

  • src/
    • syntax.ts - TypeScript source code
    • kolmo.css - Styles and color theme
  • dist/ - Compiled JavaScript and processed CSS
  • index.html - Usage example
  • tsconfig.json - TypeScript configuration

Color Theme

The project uses the Catppuccin Frappé theme, providing a pleasant and high-contrast visual experience. Colors are defined as CSS variables for easy customization.

Customization

Theme Configuration via TypeScript

You can configure the theme programmatically:

  1. Using the init function with options:
init({ theme: 'frappe' }); // or 'one-dark'
  1. Changing theme at runtime:
setTheme('one-dark'); // or 'frappe'

The theme selection is persisted in localStorage and will be restored on page reload.

Fonts and Styling via CSS

You can customize fonts and other styles by creating your own configuration file. Include it after the base CSS and theme files:

<link rel="stylesheet" href="dist/kolmo.css">
<link rel="stylesheet" href="dist/themes/frappe.css">  <!-- or other theme -->
<link rel="stylesheet" href="path/to/your-config.css">

Available font variables:

:root {
  --kolmo-font-family: 'Your Font', monospace;
  --kolmo-font-size: 16px;
  --kolmo-line-height: 1.6;
  --kolmo-font-weight-normal: 400;
  --kolmo-font-weight-bold: 600;
}

Optional styling variables:

:root {
  --kolmo-block-padding: 1.5rem;
  --kolmo-block-border-radius: 8px;
}

See themes/config.css for a complete example of customization options.

Theme Customization

The project uses the Catppuccin Frappé theme by default. You can create your own theme by overriding the CSS variables:

  1. Create a new CSS file (e.g., my-theme.css)
  2. Define your color variables:
:root {
  --kolmo-comment: #666666;      /* Comments */
  --kolmo-char: #98c379;         /* Characters */
  --kolmo-number: #d19a66;       /* Numbers */
  --kolmo-constructor: #c678dd;  /* Constructors */
  --kolmo-symbol: #56b6c2;       /* Special symbols (λ, Π, ∀) */
  --kolmo-operator: #e06c75;     /* Operators */
  --kolmo-declaration: #c678dd;  /* Keywords: data, import */
  --kolmo-definition: #d19a66;   /* Keywords: def, gen */
  --kolmo-control: #e5c07b;      /* Keywords: if, else, case */
  --kolmo-variable: #61afef;     /* Variables */
  --kolmo-match: #98c379;        /* Keywords: match, switch */
  --kolmo-delimiter: #c678dd;    /* Delimiters: (), [], {} */
  --kolmo-punctuation: #e5c07b;  /* Punctuation: , ; : . */
}

/* Optional: Override the background and text colors */
.kolmo-syntax {
  color: #abb2bf;               /* Default text color */
  background-color: #282c34;    /* Background color */
}
  1. Include your theme file after the default theme:
<link rel="stylesheet" href="dist/kolmo.css">
<link rel="stylesheet" href="path/to/my-theme.css">

Available theme variables and their usage:

| Variable | Description | |----------|-------------| | --kolmo-comment | Single-line comments starting with // | | --kolmo-char | Character literals | | --kolmo-number | Numeric literals | | --kolmo-constructor | Constructors (#Name), <>, ->, [] | | --kolmo-symbol | Special symbols like λ, Π, ∀ | | --kolmo-operator | Mathematical and logical operators | | --kolmo-declaration | Declaration keywords (data, import) | | --kolmo-definition | Definition keywords (def, gen) | | --kolmo-control | Control flow keywords | | --kolmo-variable | Variable names | | --kolmo-match | Pattern matching keywords | | --kolmo-delimiter | Brackets and parentheses | | --kolmo-punctuation | Punctuation marks |