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

@shopify/get-repo-images

v0.3.2

Published

An extremely fast repository crawler to find images across multiple repos

Downloads

70

Readme

@shopify/get-repo-images

  • ⚡️ An extremely fast repository crawler to find images across multiple repos
  • 🌌 Find where the images are referenced in code... or not!
  • 💾 Save the results to a JSON file
  • 🌏 Generate a Next.js website to browse, sort and filter images
  • 🪆 Sort by the file size, date created and number of references
  • 🔗 Read about Shopify's journey

As Shopify has scaled, our usage of illustrations in code has become fragmented across 6000+ repositories. We recently updated our illustration style and finding the illustrations, prioritising them, removing or updating them across our codebase was a challenge. We hope that @shopify/get-repo-images will be useful for anyone maintaining images at scale.

| Status | Owner | Help | | --- | --- | --- | | Experimental | @polaris-team | New issue |

How to use

Make sure you have Node.js version 14 or later, then run this command from your terminal to to browse, sort and filter images from alex-page/alexpage.com.au on a Next.js website at http://localhost:3000

npx @shopify/get-repo-images -repo alex-page/alexpage.com.au

Create the files for a Next.js website into the ./repo-images-site directory

npx @shopify/get-repo-images -build -repo alex-page/alexpage.com.au

Note: If you want to run the website you can run cd repo-images-site && npm i && npm run dev

Generate a JSON file with results to ./images.json

npx @shopify/get-repo-images -json -repo alex-page/alexpage.com.au

Private repositories

Add a personal access token for private repositories. Replace TOKEN with your token.

npx @shopify/get-repo-images -repo alex-page/alexpage.com.au -token TOKEN

Advanced usage

Create a repos.config.json file and use the -config flag to access advanced options. These allow you to get the images from multiple repositories, specific image extensions or allow minimum image sizes.

npx @shopify/get-repo-images -config
{
  "repos": [
    {
      "repo": "shopify/mobile",
      "minSize": 1000,
      "extensions": ["webp"],
      "usageMatchers": ["drawable"],
      "usageNoExtension": true
    },
    {"repo": "alex-page/harmonograph.art"},
  ]
}

Technical details

@shopify/get-repo-images is built using the following technologies:

  • go, a programming language https://golang.org/
  • go-git, git implementation for go https://github.com/go-git/go-git
  • Next.js, a react framework https://nextjs.org