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

kalcify-markdown-to-confluence

v0.1.0

Published

Convert Markdown to Confluence Cloud rich-text HTML and Server/Data Center wiki markup, with conversion notices.

Readme

Markdown to Confluence

Use the free online converter for rich-text copying without installing anything.

Markdown pasted into Confluence Cloud can appear as literal text or code instead of formatted content. The Cloud editor does not accept wiki markup (Atlassian documentation). This package converts Markdown into rich-text HTML for Cloud paste, or wiki markup for Server/Data Center editors that accept it.

Install

Requires Node.js 20 or later. ESM only; the library also works in browser bundles.

npm install kalcify-markdown-to-confluence

Library

import {
  convertMarkdown,
  noticesFor,
  noticeText,
} from 'kalcify-markdown-to-confluence';

const result = convertMarkdown('# Hello\n\nA **bold** start.');
console.log(result.cloudHtml); // <h1>Hello</h1><p>A <strong>bold</strong> start.</p>
console.log(result.wikiMarkup); // h1. Hello\n\nA *bold* start.

for (const notice of noticesFor('cloud', result.notices)) {
  console.warn(noticeText(notice));
}

convertMarkdown(markdown) parses once and returns both outputs, counts, and notices. Counts cover headings, tables, code blocks, ordinary list items, tasks, links and images. Each notice has an id, target (cloud, wiki or both), and count. TypeScript exports include Conversion, ElementCounts, Notice, NoticeId and Target.

For Cloud, put cloudHtml on the clipboard as text/html, then paste into the editor. In a browser, call this from a click handler on HTTPS or localhost:

await navigator.clipboard.write([
  new ClipboardItem({
    'text/html': new Blob([result.cloudHtml], { type: 'text/html' }),
  }),
]);

Clipboard permissions and browser support apply. Copying the HTML source from a terminal does not create rich text. The output targets editor paste, not Confluence storage-format XML or an API upload payload. Review the pasted result in your editor.

CLI

npx kalcify-markdown-to-confluence input.md > output.html
npx kalcify-markdown-to-confluence --target wiki input.md > output.wiki
cat input.md | npx kalcify-markdown-to-confluence --target cloud

The default target is cloud. Omit the file, or use -, to read UTF-8 Markdown from stdin. Output goes to stdout with a trailing newline (empty input stays empty); notices for the selected target go to stderr. Use --help for usage. Invalid arguments or unreadable input exit with status 1.

Supported Markdown and limits

CommonMark plus GitHub Flavored Markdown: headings, paragraphs, bold, italic, strikethrough, inline and fenced code, nested lists, task lists, tables, quotes, rules, hard breaks, links, reference links, autolinks and images.

Conversion notices describe losses:

  • Raw HTML is shown as code; comments are removed. Inline <br> becomes a line break.
  • Footnotes become superscript labels with note text at the definition, without navigation.
  • Relative image paths need manual upload/replacement in Confluence.
  • Unsafe URL schemes become plain text. Links allow HTTP(S), mail and telephone; images allow HTTP(S).
  • Table column alignment is discarded.
  • Cloud lists containing only tasks use action-item HTML; tasks mixed with ordinary items keep text checkboxes.
  • Wiki tasks keep text checkboxes. Code blocks, tables and quotes inside wiki list items are emitted after the item.
  • Wiki backslashes that cannot be represented are dropped. Code containing both {code} and {noformat} needs manual correction.

Nested quotes are flattened. Wiki ordered lists start at 1. Images remain references; the package does not upload attachments or contact Confluence.

Development

npm ci
npm run typecheck
npm run check:architecture
npm test
npm run build
npm pack --dry-run

The converter and regression tests were extracted from Kalcify; the public entry point is src/convert.ts. Markdown decoding belongs to mdast-util-from-markdown with GFM extensions; both renderers, counts and notices derive from its tree. Public declarations are generated by TypeScript. CLI argument parsing belongs to Node's util.parseArgs; target narrowing happens at that boundary. Runtime dependencies are the four mdast/micromark packages used by the converter. No persistence, environment configuration or remote API is involved.

Build output is regenerated from src and never committed. MIT licensed; see LICENSE.