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

plain-text-tools

v1.0.0

Published

A CLI toolkit for Markdown ↔ HTML conversion

Downloads

101

Readme

Plain Text Tools (ptt)

A small, focused CLI toolkit for Markdown ↔ HTML conversion, built with Node.js and TypeScript.

Philosophy

"The Pragmatic Programmer" emphasizes the Power of Plain Text: plain text is the lowest common denominator, readable by humans and machines alike, and never becomes obsolete. This tool embodies that philosophy by providing simple, composable conversions between two of the most common plain text formats: Markdown and HTML.

Plain text tools are powerful because they:

  • Compose well: Chain tools together with pipes
  • Never become obsolete: Plain text formats outlive proprietary formats
  • Are transparent: You can always inspect and modify the data
  • Work everywhere: From scripts to CI/CD pipelines

Installation

npm install
npm run build

For global installation (after building):

npm link

Usage

Markdown to HTML

Convert a Markdown file to HTML:

ptt md2html input.md -o output.html

Read from stdin and write to stdout:

cat README.md | ptt md2html > output.html

Read from stdin and write to a file:

cat input.md | ptt md2html -o output.html

HTML to Markdown

Convert an HTML file to Markdown:

ptt html2md input.html -o output.md

Read from stdin and write to stdout:

curl https://example.com | ptt html2md > output.md

Read from stdin and write to a file:

cat input.html | ptt html2md -o output.md

Examples

Basic Conversion

# Markdown → HTML
ptt md2html README.md -o README.html

# HTML → Markdown
ptt html2md page.html -o page.md

Pipeline Usage

# Convert multiple files
for file in *.md; do
  ptt md2html "$file" -o "${file%.md}.html"
done

# Chain conversions
ptt md2html doc.md | ptt html2md | ptt md2html -o doc-roundtrip.html

Integration with Other Tools

# Convert and serve
ptt md2html README.md | python3 -m http.server 8000

# Extract content from web and convert
curl -s https://example.com/article | ptt html2md > article.md

Features

  • Markdown → HTML: Full Markdown support including GitHub Flavored Markdown
  • HTML → Markdown: Best-effort conversion preserving structure and content
  • stdin/stdout support: Composable with other Unix tools
  • TypeScript: Type-safe implementation
  • Clean architecture: Modular, composable code

Project Structure

src/
  cli.ts          # CLI interface and command definitions
  md2html.ts      # Markdown to HTML conversion
  html2md.ts      # HTML to Markdown conversion
  utils/
    fs.ts         # File system utilities (stdin/stdout handling)

Development

# Build
npm run build

# Watch mode
npm run dev

# Run locally
node dist/cli.js md2html input.md -o output.html

License

MIT