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

imagedown-example

v1.0.0

Published

图片下载工具案例,用于 Node.js 教学参考。

Readme

imagedown-examples

图片下载工具案例,用于 Node.js 教学参考。

技能点

  • ESM + TypeScript 打底
  • Node.js CLI 程序的基本写法
  • Node.js fs、path、buffer 模块的基本用法
  • fetch、URL 标准 Web API 的用法
  • http 请求、响应的处理方法
  • Promise 异步编程技巧
  • 手撕并发编程算法

用法

npx imagedown-examples --help

imagedown-examples <url> <folder>

下载网页中的图片到指定文件夹

Positionals:
  url     需要爬取图片的网页 URL                                        [string]
  folder  保存图片的本地文件夹路径                                      [string]

Options:
      --version      Show version number                               [boolean]
  -h, --help         Show help                                         [boolean]
  -c, --concurrency  控制图片下载的并发数量                [number] [default: 1]

样例命令:

npx imagedown-examples --concurrency 3 https://www.bing.com/images/ ./images
> downloading html...
> downloaded html, length = 758484
> extracted 47 images from html
> downloading images...
> (1/47) downloading https://r.bing.com/rp/f21jlSMmEDN43OaavcdaB-7Phq0.svg
> (2/47) downloading https://r.bing.com/rp/fdVZU4ttbw8NDRm6H3I5BW3_vCo.svg
> (3/47) downloading https://r.bing.com/rp/4L4QdyjTv0HYE2Ig2ol9eYoqxg8.svg
> (4/47) downloading https://r.bing.com/rp/Fsa_OI0AplCnVoXGca8ALOo0S0s.svg
> ...
> (47/47) downloading data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAANElEQVQokWMwTtv9nxzMMKpxhGv8/x+B0SQXIMuhY1waLwCxAKkaPwCxAT5NuDQmENIEwgA05eEwFjHcAQAAAABJRU5ErkJggg==
> done
> saved images: [
  'images/Cool Discord Profile Pics.jpeg',
  'images/OneRepublic Wallpapers (45 images) - WallpaperCat.jpeg',
  'images/Solve pure love jigsaw puzzle online with 80 pieces.jpeg',
  'images/Spider Fawn Library | Cinematic photography, Art photography, Photography inspiration.jpeg',
  'images/Cars Aesthetic Wallpapers · 280+ Backgrounds 🚗🚕🚙.jpeg',
  ...
]

开发

npm run watch
node bin/main.js --concurrency 3 https://www.bing.com/images/ ./images