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

bkd-puppeteer

v1.0.0

Published

Having some web scrapping fun with Puppeteer

Downloads

4

Readme

Puppeteer: CLI based Website Screenshots

This is a straight forward Puppeteer based website screenshot generator.

How it works

We use Puppeteer to initially try and fetch the first nav > ul > li > a of a given domain.

For every qualifying navigation item we find, we push the title and href values into an array. Then we simply iterate through that array, goto that url and take both a default deview viewport screenshot as well as a full-page screenshot.

Installation & Configuration

  • Git clone https://github.com/ScoutsOut/bkd-puppeteer
  • Run npm i
  • Create an .env file in the root of the project's directory
    • You'll also need to provide a few baseline variables as shown below (If the site has simple authentication, provide a username and password):
    HOST=https://npr.com
    USER=yourUserName
    PASS=yourPassword
    DESTINATION=build-directory-of-choice

Where generated screenshots are generated

  • Whichever directory you've dicated within .evn, the Puppeteer bot will create directories by page and device.
  • The file names have the following format: Page name - Device name - Height - width.jpg
    • Realworld example: Contact Us-iPad-768x1024.fullscreen.jpg

###Available Scripts

  • npm run puppet
  • npm run puppet-dev - only difference is the use of nodemon

#####Hopefully someone out there will find this helpful. I'm going to continue to extend this (mostly for my own personal development).