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

@cronicorn/billing-engine

v1.0.0

Published

A modular web scraping framework written in TypeScript, designed around three pluggable responsibilities—**fetching**, **parsing**, and **writing**—with clear contracts to enable easy extension and testing.

Readme

Project Overview

A modular web scraping framework written in TypeScript, designed around three pluggable responsibilities—fetching, parsing, and writing—with clear contracts to enable easy extension and testing.


📁 Folder Structure

  • src/

    • Fetchers: handle HTTP requests, retries, timeouts, and rate-limit behavior.
    • Parsers: convert raw responses (HTML, JSON) into well-typed domain objects.
    • Writers: persist structured data to files, databases, or other storage backends without overwriting existing content.
    • Types: define shared interfaces (e.g. parser and writer contracts) and data models.
    • Utilities: logging, error handling, and helper functions.
    • Configuration: lists scraping jobs by name, URL, parser, and writer, driving the orchestration.
    • Entry Point: the bootstrap script that ties together fetchers, parsers, and writers in a workflow.
  • output/: generated data exports (JSON, CSV, etc.).

  • tests/: unit and integration tests for each module.

  • package.json, tsconfig.json, and other root-level manifests for dependencies and tooling.


🔌 Core Concepts

  • Fetcher A service that retrieves remote content with configurable options (timeouts, retries, headers) and exposes a fetch method returning raw text.

  • Parser A component implementing a parse(html: string): T[] contract, responsible for extracting structured domain objects from raw input.

  • Writer A component implementing a write(data: T[]): Promise<void> contract, handling data persistence and ensuring files or database records are created only when absent.

  • Job Configuration

    • Each job has a unique identifier, target URL, parser instance, and writer instance.
    • Jobs are defined in a centralized configuration module, allowing new sources to be added without modifying core orchestration logic.
  • Orchestration Flow

    1. Iterate through configured jobs.
    2. Fetch raw content for each job.
    3. Parse content into typed objects.
    4. Write parsed data to the appropriate sink.
    5. Log successes and handle errors gracefully.

🛠️ Extensibility & Maintenance

  • Adding Data Sources: Implement a new parser module adhering to the parser interface and register it in the configuration.
  • Extending Storage Backends: Implement a new writer module conforming to the writer interface for any storage system (e.g., cloud storage, message queues).
  • Scalable Configuration: All jobs live in a single config file, minimizing touchpoints when scaling up.
  • Testing: Keep tests close to implementation; add unit tests for fetchers, parsers, and writers to ensure resilience.

📦 Tools & Libraries

  • HTTP Client: Axios (or similar) for flexible request options.
  • User-Agent Rotation: Generates realistic headers for each request.
  • DOM Parsing: Cheerio or equivalent for HTML scraping.
  • File I/O: Node.js fs/promises for reading and writing files.
  • Logging: A simple logging utility to capture flow and errors.