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

lanhu-image-downloader

v0.0.1

Published

下载蓝湖设计稿的切图到本地, just 省点力气。 * 支持下载整个项目 * 支持下载某个组 * 支持下载某个设计稿 * 支持中文转英文命名 * 支持下载1倍图或者2倍图 * 支持下载后调整尺寸

Downloads

11

Readme

这是啥

下载蓝湖设计稿的切图到本地, just 省点力气。

  • 支持下载整个项目
  • 支持下载某个组
  • 支持下载某个设计稿
  • 支持中文转英文命名
  • 支持下载1倍图或者2倍图
  • 支持下载后调整尺寸

蓝湖结构

  • team 团队
    • project 项目
      • group 组
        • image 图片(设计稿)(包干多个切图)
          • slice 切图

流程 & 图

API参数api.md

  1. 获取一个项目的所有图片(设计稿)信息
  2. 获取一个项目的所有图片(设计稿)分组信息
  3. 通过1,2能知道某个分组的所有图片(设计稿)信息
  4. 通过API获得某个图片(设计稿)的所有版本
  5. 最新的版本有一个json_url字段,通过该字段获取所有资源信息
  6. 挨个下载资源
  7. 默认2倍图,如果需要一倍图,获取尺寸,缩减尺寸
  8. 图片压缩

TODO:: 流程图

第三方库

  1. 获取图片大小 https://www.npmjs.com/package/image-size
const sizeOf = require('image-size')
sizeOf('images/funny-cats.png', function (err, dimensions) {
  console.log(dimensions.width, dimensions.height)
})
  1. 重置图片大小 https://www.npmjs.com/package/sharp
sharp(inputBuffer)
  .resize(320, 240)
  .toFile('output.webp', (err, info) => { ... });

TODO

  • [x] 封装蓝湖处理部分 (2025-02-12)
  • [x] 组名为未分组的特殊处理 (2025-02-12)
  • [x] 地址反向解析, 通过地址识别是单个 设计稿|组|项目 (2025-02-15)
  • [x] 下载源头就选择1倍 或者 2倍 (2025-02-15) (无需此操作)
  • [x] isMergeData模式导致多下载图片的问题 (V1修复版本) 判断父是否可以导出 + layer-group的特殊判断 (2025-03-05)
  • [x] 下载的图片与蓝湖显示的尺寸大小不一样的问题,目前分析是蓝湖web端做了处理 (2025-03-04) 下载图片后,按照尺寸调整图片大小(sharp)
  • [ ] 图片下载格式选择(png, jpg, webp)
  • [ ] 图片下载格式选择 svg
  • [ ] 完善日志
  • [ ] 打包发布