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

@mahope/clean-copy

v1.5.3

Published

Copy/paste text as clean Markdown or plain text — the Clean Copy converter as a command-line tool

Downloads

33

Readme

clean-copy (CLI)

Version License Homebrew GitHub Action Node Dependencies

Copy/paste text as clean Markdown or plain text — straight from your terminal. The same converter engine that powers the Clean Copy browser extensions, packaged as a zero-dependency Node.js CLI. Product page: https://cleancopy.tools/

CLI demo

Use cases

| Use case | Command | |----------|---------| | Convert an HTML file to Markdown | clean-copy article.html | | Fetch a web page as readable Markdown | clean-copy -u https://example.com/blog | | macOS: paste dirty HTML, get clean Markdown | pbpaste \| clean-copy \| pbcopy | | Linux: same with xclip | xclip -o \| clean-copy \| xclip -selection c | | Git commit message from PR description | curl -sL https://github.com/... \| clean-copy -t | | Strip formatting from email snippets | clean-copy -t email_dump.html | | CI: convert a URL to Markdown in a workflow | See GitHub Action below |

Install

One-line install (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/mahope/clean-copy-cli/main/tools/install.sh | bash

Installs to ~/.local/bin (add it to PATH if it isn't already). Requires Node.js 16+.

Homebrew (macOS / Linux, recommended)

brew install mahope/tap/clean-copy

Direct download (no package manager)

curl -L https://github.com/mahope/clean-copy-cli/releases/download/v1.5.2/clean-copy-1.5.2.tar.gz \
  | tar xz --strip-components=1
sudo cp clean-copy.js /usr/local/bin/clean-copy

npx — run without installing (no account needed)

npx @mahope/clean-copy -u https://example.com
# or install globally:
npm install -g @mahope/clean-copy

From source

git clone https://github.com/mahope/clean-copy-cli.git
cd clean-copy-cli
# Run in place:
./clean-copy.js -u https://example.com
# Or install globally:
npm link

Requires Node.js 16+. Zero npm dependencies — the converter is pure JavaScript.

Quick start

# Convert HTML from stdin
echo '<h1>Hi</h1><p>Some <b>bold</b> text</p>' | clean-copy
# → # Hi\n\nSome **bold** text

# Convert a local HTML file to Markdown
clean-copy -o output.md article.html

# Fetch a web page and extract readable content as Markdown
clean-copy -u https://en.wikipedia.org/wiki/Markdown > wikipedia.md

# Plain text mode (strips all Markdown formatting)
clean-copy -t rich_text.html

# macOS: round-trip clipboard through cleaner
pbpaste | clean-copy | pbcopy

# Copy result to clipboard AND save to file
clean-copy -c -o cleaned.md dirty.html

GitHub Action

Convert any URL, local file, or raw HTML to clean Markdown directly in your workflow:

- uses: mahope/clean-copy-cli@v1
  with:
    url: 'https://example.com/article'
  id: clean-copy

- name: Save the result
  run: echo "${{ steps.clean-copy.outputs.markdown }}" > article.md

Convert a local HTML file in the repo:

- uses: mahope/clean-copy-cli@v1
  with:
    file: 'docs/draft.html'
    output_file: 'docs/draft.md'

Convert raw HTML from a CI step:

- uses: mahope/clean-copy-cli@v1
  with:
    html: '<h1>Generated</h1><p>CI output</p>'
    mode: 'markdown'

| Input | Default | Description | |----------------|--------------|----------------------------------------------------------------| | url | (optional) | URL to fetch and convert (one of url/file/html required) | | file | (optional) | Path to a local HTML file in the repo to convert | | html | (optional) | Raw HTML string to convert directly | | mode | markdown | Output format: markdown or plain | | output_file | (optional) | Write the result to this file path for use in later steps |

Output: markdown — the converted content.

Example: weekly page snapshot as a PR

name: Weekly snapshot
on:
  schedule:
    - cron: '0 6 * * 1'  # Monday 06:00 UTC
jobs:
  snapshot:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: mahope/clean-copy-cli@v1
        with:
          url: 'https://example.com/changelog'
          output_file: 'docs/changelog-snapshot.md'
      - uses: peter-evans/create-pull-request@v6
        with:
          commit-message: 'chore: update changelog snapshot'
          title: 'Weekly changelog snapshot'
          branch: snapshot/changelog

Options

| Flag | Effect | |------|--------| | -t, --text | plain text output instead of Markdown | | -w, --wikilinks | Obsidian-style output: internal links become [[WikiLinks]]; external links, images and code blocks are untouched | | -v, --csv | tables become comma-separated CSV rows (RFC 4180); no tables → cleaned plain text | | -u, --url URL | fetch a web page and extract its main content | | -o, --out FILE | write to FILE instead of stdout | | -c, --copy | also copy the result to the system clipboard | | -q, --quiet | no summary line on stderr | | -V, --version | print version |

What it converts

Headings (#–######), bold/italic, links, images, nested lists, ordered lists, code blocks with entity decoding (&lt; becomes <), blockquotes and tables → GitHub-flavored pipe tables. Smart quotes, em-dashes, zero-width characters and &nbsp; junk are normalized to clean ASCII.

The --url mode strips scripts, styles, nav/footer boilerplate and keeps the largest content block — good for articles, docs pages and blog posts.

Supported platforms

The --url extraction mode is tested live (in test.js) against real pages from every major publishing platform. If it works on your site, it works — the extractor is CMS-agnostic and never requires anything installed on the server.

| Platform | Live-tested example | |----------|---------------------| | MediaWiki | Wikipedia | | Shopify (custom storefront) | shopify.com/blog | | Wix | wix.com/blog | | Squarespace | blog.squarespace.com | | Ghost | ghost.org/resources · 404media.co | | Substack | Astral Codex Ten · The Pragmatic Engineer | | Astro / static site | astro.build | | WordPress | CSS-Tricks | | Next.js | deno.com/blog | | Eleventy | v8.dev | | Custom static | blog.rust-lang.org |

All of these run in CI on every push — a regression on any platform fails the build.

Privacy

No analytics, no tracking, no telemetry. The only network request ever made is the one you trigger with --url. Everything else runs locally.

Releasing

npm run release -- patch (or minor/major) bumps the version, commits and pushes the tag. CI publishes to npm and creates the GitHub release.

License

MIT

Author

Built by Mads Holst Jensen — developer and technical partner for small businesses, Odense, Denmark. https://mahoje.dk