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

kairos-parser

v0.4.0

Published

The shared kernel of the kairos platform. One package, consumed by **both** apps (the student frontend *kairos* and the back office *DigitalSkills-UI* — always at the **same version**), shipping:

Downloads

74

Readme

kairos-parser

The shared kernel of the kairos platform. One package, consumed by both apps (the student frontend kairos and the back office DigitalSkills-UI — always at the same version), shipping:

  1. The parser — turns our markdown custom tags into HTML, so the same content renders identically everywhere.
  2. The design tokens — the brand & faculty color palettes, single source of truth for colors.
  3. The parser-output styles — the compiled CSS that styles the HTML the parser emits.

The parser

parseCustomTags(str: string, codeColor?: string): string

Parses a string containing our custom markdown tags and replaces them with the matching HTML structures — e.g. '<p>!!! information' becomes a div structure with an information icon and a content area. codeColor is the referential's color name ('math', 'psychology', …): it tints the emitted icons and tables through the palette classes (bg-<codeColor>-600).

import { parseCustomTags } from 'kairos-parser';

const htmlContent = parseCustomTags(markdownContent, referentialCodeColor);

getToolbarConfig(mode: ToolbarMode, saveCallback?, linkCallback?)

The EasyMDE toolbar configuration: mode (the ToolbarMode enum — READ, COURSE, …) drives which buttons appear, saveCallback saves the editor content, linkCallback opens the internal-link selector.

import * as EasyMDE from 'easymde';
import { getToolbarConfig, ToolbarMode } from 'kairos-parser';

const editor = new EasyMDE({
  element: this.textarea.nativeElement,
  previewRender: (text) => parseCustomTags(text, this.referentialCodeColor),
  toolbar: getToolbarConfig(
    ToolbarMode.COURSE,
    () => this.saveRecord(),
    () => this.openLinkSelector(),
  ),
});

The styles

Parser-output CSS

Add the compiled CSS to the styles array of angular.json:

"styles": [
  "node_modules/kairos-parser/css/main.css",
  "src/styles/styles.scss"
]

(Alternative: @import 'kairos-parser/css/main.css'; at the top of the global styles.scss.) css/main.css travels with the parser version that generates the matching HTML — never restyle the parser output inside an app.

Design tokens

One scss module gives everything:

@use 'kairos-parser/scss/tokens' as t;

$primary: t.$kairos-600;           // compile-time values — derive, never copy hexes
:root { @include t.palette-vars; } // the same palette as CSS custom properties

Apps must derive their semantic variables from the palette ($primary: t.$kairos-600) instead of copying hex values; components can then consume var(--kairos-600) at runtime once palette-vars is included on :root.

Releasing

npm run release            # bump + CHANGELOG + tag vX.Y.Z (commit-and-tag-version, local only)
npm run release:publish    # push --follow-tags + npm publish

npm publish always runs a full fresh build first (prepublishOnly hook) — publishing stale or missing dist//css/ artifacts is not possible (scss/ is tracked source, nothing to build). Then bump the version in both consumer apps.

Local development

The demo

demo/ is an Angular app that builds the library sources live (its tsconfig maps kairos-parser to ../src, its sass load paths cover ../scss and ../src/styles) — edit the library, the demo reloads, no build or publish needed:

cd demo && npm start

Against a real app (yalc)

# package side — rebuild + push into linked apps on every save:
npm run watch:yalc

# app side (kairos or DigitalSkills-UI):
npx yalc add kairos-parser        # wires the local copy into node_modules
#   …develop; if a change does not show up, restart the app's dev server
#   (Angular pre-bundles node_modules; `ng cache clean` for stubborn cases)
npx yalc remove kairos-parser && yarn install   # back to the npm version

⚠️ While linked, the app's package.json points at file:.yalc/… — never commit in that state.

Scripts

| Script | Role | |---|---| | build | clean + compile the css (build:css, with --load-path=scss) + compile the TypeScript (build:ts) | | clean | remove dist/ and css/ (the build artifacts — scss/ is source) | | prepublishOnly | runs build automatically before any npm publish | | release / release:publish | see Releasing above | | yalc / watch:yalc | see Against a real app above |