New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

micron-parser

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons

micron-parser

A JavaScript Micron (.mu) parser for rendering Micron as HTML

unpublished
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
159
-71.2%
Maintainers
0
Weekly downloads
 
Created
Source

Micron Parser JS - NPM Version

This NPM package provides a JavaScript parser for Micron, a lightweight, terminal-friendly markdown format used in NomadNet and MeshChat

Usage

import MicronParser from 'micron-parser';
// Create a new parser (darkTheme = true/false)
const parser = new MicronParser(true);

// Input Micron markup
const micronMarkup = `
> Example Heading
-∿
This is a simple line in Micron.
# This line is a comment and won't appear in the output.
`;

// Convert Micron to an HTML string
const htmlOutput = parser.convertMicronToHtml(micronMarkup);

// Insert it into your page
document.getElementById('yourElement').innerHTML = htmlOutput;

// Or create a DocumentFragment from Micron
const domFragment = parser.convertMicronToFragment(micronMarkup);
// and append it to the DOM
document.body.appendChild(domFragment);

Best practices

For optimal display of Micron content in the browser it's recommended to use a monospaced font such as Roboto Mono, available through Google Fonts, or wrap content in a <pre> tag

The line height for your container should also be set to line-height: normal !important; to better match the terminal environment

Keywords

micron

FAQs

Package last updated on 10 Feb 2025

Related posts