Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
node-pngcrush 一个进行png图片压缩的node native插件
C Objective-C HTML JavaScript C++ Makefile Other
branch: master
Failed to load latest commit information.
lib 'win'
src use `nan` support 0.12.0
test use `nan` support 0.12.0
.gitignore init
.npmignore update
README.md update README.md
binding.debug.js init repo
binding.gyp update
binding.js use `nan` support 0.12.0
build.js build script
build.sh build script
index.js fix npm install
install.js update
package.json update

README.md

node-pngcrush

NPM version

node-pngcrush是一个node的插件,它把pngcrush内嵌到了插件中,而不是调用命令行的方式,提升处理速率,有效的省去了调用外部程序产生的时间开销。

安装

npm install -g node-pngcrush

使用

var C = require('node-pngcrush');

fs.readFile('./alphatest.png', function (err, data) {
  if (err) throw err;
  var buffer = C.compress(data);
  fs.writeFile('./alphatest_out.png', buffer, {
      flags: 'wb'
  }, function(err){});
});

Something went wrong with that request. Please try again.