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 🙏

© 2025 – Pkg Stats / Ryan Hefner

postlight2md

v0.5.0

Published

[![npm](https://img.shields.io/npm/v/postlight2md)](http://npmjs.com/package/postlight2md)

Downloads

9

Readme

postlight2md

npm

postlight2md is a command-line tool that uses the Postlight Parser to extract content from web pages and convert it into different formats such as HTML, Markdown, or plain text.

Installation

To install postlight2md, you need to have Node.js installed. Then, you can install it globally using npm:

npm install -g postlight2md

Usage

You can use postlight2md by providing a URL to parse. The default output format is Markdown.

postlight2md <url> [options]

Options

  • -f, --format <format>: Set content type (html|markdown|text). Default is markdown.
  • -H, --header <header>: Include custom headers in the request. Can be used multiple times.
  • -e, --extend <extend>: Add a custom type to the response. Can be used multiple times.
  • -E, --extend-list <extend-list>: Add a custom type with multiple matches. Can be used multiple times.
  • -a, --add-extractor <extractor>: Add a custom extractor at runtime.
  • -o, --output [filename]: Specify the output file name. If not provided, the title of the content will be used to generate the file name.
  • -u, --url-file <file>: Specify a file containing URLs to process, one per line.
  • -c, --concurrency <number>: Number of concurrent requests. Default is 1.

Examples

Convert a web page to Markdown:

postlight2md https://example.com

Convert a web page to HTML:

postlight2md https://example.com -f html

Include custom headers in the request:

postlight2md https://example.com -H "Authorization=Bearer token"

Add a custom type to the response:

postlight2md https://example.com -e "customType=value"

Add a custom extractor at runtime:

postlight2md https://example.com -a "./path/to/extractor.js"

Specify the output file name:

postlight2md https://example.com -o custom-filename.md

Automatically generate the output file name based on the title:

postlight2md https://example.com -o

Process URLs from a file with default concurrency:

postlight2md -u urls.txt

Process URLs from a file with specified concurrency:

postlight2md -u urls.txt -c 5

Note: When using the -u option, the -o option defaults to generating filenames based on the title of each URL's content. To output to the console instead, explicitly set -o to false:

postlight2md -u urls.txt -o false

License

This project is licensed under the MIT License.


Made with ~~❤️~~ impatience and AI 🤖.