Registry / productivity / msgdown

msgdown

JSON →
library1.0.2jsnpmunverified

A simple message formatter for bold, strikethrough, underline, sub, sup, italic and code using delimiter-to-HTML conversion. Current stable version is 1.0.2, with no active development or recent releases. It provides a lightweight alternative to markdown parsers when only basic inline formatting is needed. The library allows customization of delimiters and HTML tags.

npm install msgdown
INSTALL
IMPORT
SIG · MSGDOWN
M
msgdown
productivityjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import msgdown from 'msgdown';
const msgdown = require('msgdown');
ESM and CJS both work, but default import is preferred in modern projects.
msgdown (CJS default)
const msgdown = require('msgdown');
const { msgdown } = require('msgdown');
The module exports a single function directly, not a named export.
TypeScript types
import msgdown from 'msgdown';
import * as msgdown from 'msgdown';
No built-in type definitions; consider using @types if available.

Converts an annotated string with delimiters into corresponding HTML tags including bold, italic, underline, strikethrough, subscript, superscript, and code.

import msgdown from 'msgdown'; const msg = '*Attention:* /msgdown/^TM^ is great¡1¡. _Use it_ or ~don\'t~ it is `console.log(\'up to you!\')`'; const html = msgdown(msg); console.log(html); // <strong>Attention:</strong> <em>msgdown</em><sup>TM</sup> is great<sub>1</sub>. <u>Use it</u> or <del>don't</del> it is <code>console.log('up to you!')</code>
Debug
Known issues
gotchaDelimiters are single characters; using multi-character delimiters will cause incorrect parsing.
fix
Use only single characters as delimiters.
affects: all
gotchaNested delimiters are not supported; markup inside other markup will be misinterpreted.
fix
Avoid nesting delimiters; process separately if needed.
affects: all
gotchaThe 'sub' delimiter is '¡' (inverted exclamation mark) which may be confused with other symbols.
fix
Use custom tokens to avoid confusion if needed.
affects: all
Errors
Common errors & fixes
TypeError: msgdown is not a function
Using destructured import { msgdown } instead of default import or require.
fix
Use 'import msgdown from "msgdown";' or 'const msgdown = require("msgdown");'
undefined is not a function (evaluating 'msgdown(msg)')
Importing incorrectly, e.g., 'import * as msgdown from "msgdown";' yields an object with no callable function.
fix
Use default import: 'import msgdown from "msgdown";'
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources
msgdown — npm install msgdown · libregistry