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

image2local

v1.0.5

Published

a tool,a potentially effective tool

Downloads

4

Readme

why i2l?

将 cdn 的图片,下载到本地。以满足图片域名为当前访问域名

原理

prettier格式化,再用正则替换匹配到的字符。

说明

  • 在代码中注视掉的模块,我们无法格式化,这会导致一些匹配上出现的错误,和冗余的资源下载,但是基于正则的模式下,这很难避免。
  • 即使提供了全量一次性替换,仍然建议少量多次,具体请查看i2l -h
  • 下载限制同时 10 条,会重试
  • 即使项目中已经把静态图片转为本地,但是服务端下发的图片,仍然是无法处理的,所以服务端下发的图片,建议过一层裁剪服务,以达到图片域名为当前访问域目的。
  • 无依赖追踪,所以可能存在有复杂关联场景时,漏处理,需手动替换。

可转换的格式

.js | .jsx

  src = "***"
  backgroundImage= "url(***)"
  "***" # 普通变量

.less

url('xxx')

使用

安装

npm i -g image2local

// or

npx image2local

指令

all

  • 说明:转换整个项目
  • 输入:马甲包名,无可不传,用','隔开
  • 可选参数:-l | --loglevel
    • error
    • warn
    • info
    • debug
  • 示例:
i2l all "windmoon,taoYu,sweetlove,finelove,peach,sweetface" --loglevel=error

pkg

  • 说明:转换一个马甲包
  • 输入:路径
  • 可选参数:-l | --loglevel
    • error
    • warn
    • info
    • debug
  • 示例:
i2l pkg ./src/pages/windmoon --loglevel=error

page

  • 说明:转换一个具体页面
  • 输入:路径
  • 可选参数:-l | --loglevel
    • error
    • warn
    • info
    • debug
  • 可选参数:-a | --alia
  • 示例:
i2l page ./src/pages/windmoon/setPrice --loglevel=error
i2l page ./src/styles -a # 将style目录中的公共图片,转成~/style/assest/images/xxx.png

clear

  • 说明:清除当前转换内容
  • 示例:
i2l clear

docs

  • 说明:在终端查看 readme
  • 示例:
i2l docs