New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gfe-png-native

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gfe-png-native - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

binding.js

70

index.js

@@ -1,1 +0,69 @@

module.exports = require('./node-pngquant-native');
var _handle = require('./binding.js');
function Pngquant() {
this.params = '';
}
Pngquant.prototype = {
option: function (opt) {
opt = opt || {};
opt.filename = opt.filename || 'stdin.png';
if (opt.params) {
this.params = opt.params + ' ' + opt.filename;
} else {
var toString = Object.prototype.toString;
var params = [];
for (var p in opt) {
if (opt.hasOwnProperty(p)) {
switch(p) {
case 'quality':
var quality = opt[p];
if (toString.call(quality) == '[object Array]') {
var l = parseInt(quality[0]), h = parseInt(quality[1]);
if (l < 0) {
l = 0;
}
if (h > 100) {
h = 100;
}
params.push('--quality=' + l + '-' + h)
}
break;
case 'speed':
var speed = parseInt(opt[p]);
if (!speed) speed = 1;
params.push('--speed='+speed);
break;
case 'iebug':
if (opt[p]) {
params.push('--iebug');
}
break;
}
}
}
this.params = params.join(' ') + ' ' + opt.filename;
}
return this;
},
compress: function(buffer, opt) {
if (Object.prototype.toString.call(opt) == '[object Object]') {
this.option(opt);
}
if (process.versions.node >= '4.0.0') {
out = (new _handle(buffer, this.params)).compress();
} else {
var handle = new _handle.Pngquant();
out = handle.compress(buffer, this.params, function nope(){});
}
return out;
}
};
module.exports = new Pngquant;

97

package.json
{
"name": "gfe-png-native",
"version": "1.0.2",
"description": "A library for promises (CommonJS/Promises/A,B,D)",
"homepage": "https://github.com/putaoshu/gfe",
"author": {

@@ -11,41 +7,57 @@ "name": "wshxbqq",

},
"keywords": [
"gfe"
],
"contributors": [],
"bindingMap": {
"0.12.0": [
"0.12.0",
"0.12.99"
],
"0.8.0": [
"0.8.0",
"0.8.25"
],
"0.9.9": [
"0.10.0",
"0.10.99"
],
"4.0.0": [
"4.0.0",
"4.20.20"
],
"5.0.0": [
"5.0.0",
"5.99.99"
],
"6.0.0": [
"6.0.0",
"6.99.99"
]
},
"bugs": {
"url": "https://github.com/putaoshu/gfe/issues"
},
"license": "",
"main": "index.js",
"files": [
"node-pngquant-native",
"index.js"
],
"repository": {
"type": "git",
"url": "git://github.com/putaoshu/gfe.git"
},
"engines": {
"node": ">= 0.8.0"
},
"contributors": [],
"dependencies": {},
"scripts": {},
"description": "A fork from node-png-native, use for gfe only",
"devDependencies": {},
"directories": {},
"_from": "gfe-png-native@>=1.0.1 <2.0.0",
"devDependencies": {},
"_id": "gfe-png-native@1.0.2",
"_shasum": "842d790a747ba9683b1a3982d0fa012a8449f602",
"_npmVersion": "2.14.1",
"_nodeVersion": "5.4.1",
"_npmUser": {
"name": "wshxbqq",
"email": "wshxbqq@gmail.com"
},
"dist": {
"shasum": "842d790a747ba9683b1a3982d0fa012a8449f602",
"size": 4741358,
"noattachment": false,
"tarball": "http://registry.npm.taobao.org/gfe-png-native/download/gfe-png-native-1.0.2.tgz"
"shasum": "f7ece9777c7dcb0304957ee0e2128704842a11ef",
"size": 5767463,
"tarball": "http://r.cnpmjs.org/gfe-png-native/download/gfe-png-native-1.0.8.tgz"
},
"engines": {
"node": ">= 0.8.0"
},
"files": [
"bindings",
"binding.js",
"index.js"
],
"gitHead": "c5f381bad24733c1618393d97c08a1a1f2687939",
"homepage": "https://github.com/putaoshu/gfe",
"keywords": [
"gfe"
],
"license": "",
"main": "index.js",
"maintainers": [

@@ -57,7 +69,12 @@ {

],
"_resolved": "https://registry.npm.taobao.org/gfe-png-native/download/gfe-png-native-1.0.2.tgz",
"gitHead": "0d4e6bfa492f19a1fafa6383dd2e045d9d09d9f0",
"publish_time": 1453025546360,
"_cnpm_publish_time": 1453025546360,
"readme": "ERROR: No README data found!"
"name": "gfe-png-native",
"optionalDependencies": {},
"publish_time": 1464625361131,
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/putaoshu/gfe.git"
},
"scripts": {},
"version": "1.1.0"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc