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 🙏

© 2024 – Pkg Stats / Ryan Hefner

minispider

v1.0.0-pre

Published

Generate equivalent static site from living website

Downloads

4

Readme

minispider

Software that will scrape any static-like website and produce an equivalent static site.

Features:

  • The website can contain interactive JavaScript, SVG... Pages are loaded in Chrome to discover resources needed by the website as well as future pages to scan.
  • Experimental support for websites that use service workers or app cache.
  • The website can load dynamic resources as long as they're hosted outside (i.e. social widgets).
  • Works with decent-sized sites. Request and response headers of all the resources are all kept into RAM, but bodies are always saved progressively to the disk.
  • Supports exclusions (don't save a part of the website, either because it's dynamic or we don't care).
  • Saved website doesn't need to be a domain, it can be a subfolder. Or you can select resources by format. Or by prefix.
  • Can also save multiple domains, including wildcards such as saving anything at https://*.alba.sh/*.
  • As an intermediary step, this also produces a full-blown scan of the website, including resource headers, types, error page, which page references which resources, what the final rendered HTML is, etc. It can also report places where resources are loaded by absolute URL instead of relative URL, resources that are loaded through redirect, etc.

Limitations:

  • The website itself must be static or static-like. That is, requests must always return the same body, and must not return errors other than 404. Response can not vary depending on the query string, or on the headers.
  • Since this works like a web spider (scanning pages and resources recursively, starting from one or more roots) it may not discover all of them. You have to solve this manually by providing more roots or improving the scanning process yourself.

Install

This uses headless Chrome to do the scraping. By default, the version of Chrome bundled with puppeteer is used, so all you have to do is:

npm install

If you'd like to use a different Chrome executable than the bundled one, it can be changed through the configuration.

Usage

TODO