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

image-cycle-resizer

v1.0.2

Published

resizer the image to limit size.

Readme

image-cycle-resizer

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Node.js
Node.js轻量级跨平台图像编解码库(自动缩小图片到指定大小)

var ImageCycleResizer = require("image-cycle-resizer");

let ICR = new ImageCycleResizer("in/1.jpg");

ICR.setStep("/2")
    .setLimit(300*1024)
    .save( "out/1.jpg", 100 );

Support 支持情况

if node >= 10.x, please install images@latest

| Platform | Architecture | Node Version | |:------|:-------------|:------------| | Windows | x64 |8, 9, 10, 11, 12| | OSX | X64 | 8, 9, 10, 11, 12| | Linux* | x64 |8, 9, 10, 11, 12|

  • The 32-bit system is not supported for the time being.

if node <= 9.x, please install [email protected]

| Platform | Architecture | Node Version | |:------|:-------------|:------------| | Windows | x86 & x64 | 0.9.11, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 8, 10| | OSX | X64| 0.9.11, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 8, 9, 10| | Linux* | x86 & x64 | 0.9.11, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 8, 10|

Features 功能特性

  • Lightweight: no need to install any image processing library.
  • 轻量级:无需安装任何图像处理库。
  • Cross-platform: Released a compiled .node file on windows, just download and start.
  • 跨平台:Windows下发布了编译好的.node文件,下载就能用。
  • Easy-to-use: Provide jQuery-like chaining API. Simple and reliable!
  • 方便用:jQuery风格的API,简单可依赖。

Installation 安装

$ npm install image-cycle-resizer

API 接口

image-cycle-resizer provide jQuery-like Chaining API,You can start the chain like this:
image-cycle-resizer 提供了类似jQuery的链式调用API,您可以这样开始:

constructor([obj[,step=100[, limit=210241024]]])

obj: [Buffer|WrappedImage|filePath]

Load and decode image from obj

从指定文件加载并解码图像

.setStep( step )

Set the reduction step size, which can be a number, "/N"

设置缩小步长,可以为数字,“/N”

.setLimit(limit)

Set the maximum file size

设置最大文件大小

.setQuality( quality )

Set the default generated image quality

设置默认生成图片质量

.getBuff(tpye[, quality])

Get the file buffer

获得文件的buffer

.reduceWidth([step])

Zoom out the picture

缩小图片

.save(output[, quality])

Save the reduced picture

保存缩小后的图片

.start(output[quality])

Get the reduced picture

获得缩小后的图片

属性

image

Picture object

图片对象

limit

最大文件限制

step

Maximum file limit

缩小步长

quality

Default generated image quality

默认生成图片质量

NOTICE

This project is based on node-images and follows the MIT