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

screenshat

v1.2.0

Published

Take screenshots and videos of a website at different widths

Downloads

9

Readme

screenshat

Take screenshots and videos of a website at different widths

I wanted to be able to review how a page worked across a full span of sizes--not just at a few fixed sizes. I was already creating screenshots with Playwright. I tried making videos directly with Playwright, but they weren't quite how I wanted them. screenshat was born.

This project works fine for me, but it currently makes absolutely no guarantees about "stability". Defaults and command-line options are definitely subject to change as we play around with what's best.

Demo

Terminal output after running screenshat

Usage

Usage: screenshat [options] --url <url>

Take screenshots and videos of a website at different widths

Requires ffmpeg to be installed and in your PATH.

Options:
  --url <url>            URL to screenshot
  --min-width <pixels>   minimum width (default: 320)
  --max-width <pixels>   maximum width (default: 1920)
  --max-height <pixels>  maximum height in pixels, or "full" (default: 800)
  --output-dir <dir>     output directory (default: new temp directory)
  --browser <browser>    Playwright browser, like chromium, firefox, or webkit (default: "chromium")
  --no-progress          disable progress bars
  --json                 print details as JSON (it can be helpful to include --quiet)
  --output-mp4           output mp4 video
  --output-webm          output webm video
  --output-gif           output animated gif
  --output-png           output animated png
  --framerate <fps>      set frames per second for output video
  -q, --quiet            produce minimal command-line output
  -v, --verbose          produce more command-line output
  -V, --version          output the version number
  -h, --help             display help for command

Installation

screenshat expects ffmpeg to be installed and in your PATH. You can likely install ffmpeg the same way you install anything else on your computer.

If you have nodejs installed, you can run screenshat using npx:

npx screenshat --url https://google.com --min-width 320 --max-width 640 --output-gif

You can also install screenshat globally:

npm install -g screenshat

Development

Getting Started

This project is written in Javascript, and uses Node.js. If you need guidance installing Node.js, try https://nodejs.dev/en/learn/how-to-install-nodejs/.

Next, you'll want to check out this repository, downloading it to your computer. After checking out this repository, run npm install to install dependencies. You can make your changes, and then run npm run lint to check for style issues.

If you run npm link, you should be able to run screenshat as if it were installed, letting you check your changes interactively.

This project, unfortunately, does not have any automated tests yet! If you'd like to add some, please do! Once there are tests, if you can, please write tests for your changes.

Contributing

See CONTRIBUTING.md.