node-pngcrush
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,28 @@ | ||
module.exports = require('./build/Release/png_compress.node'); | ||
var fs = require("fs"), | ||
path = require("path"), | ||
name = "png_compress.node", | ||
tryList, i, count, file; | ||
tryList = [ | ||
path.join(__dirname, "build", "Release", name), // build dir | ||
path.join(__dirname, "lib", process.platform, name) // prebuild lib | ||
]; | ||
count = tryList.length; | ||
for (i = 0; i < count; i++) { | ||
file = tryList[i]; | ||
if (fs.existsSync(file)) { | ||
try { | ||
exports = require(file); | ||
} catch (e) { | ||
continue; // try next | ||
} | ||
break; | ||
} | ||
} | ||
if (exports && exports.PngCompress) { | ||
module.exports = exports; | ||
} else { | ||
throw new Error("Can't load addon."); | ||
} |
{ | ||
"name": "node-pngcrush", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "The node-pngcrush is an addon of node, as a readable/writable stream", | ||
@@ -10,4 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"install": "node install.js" | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
@@ -14,0 +13,0 @@ "repository": { |
@@ -9,3 +9,3 @@ ##node-pngcrush | ||
##使用 | ||
##!使用 | ||
@@ -12,0 +12,0 @@ ```javascript |
@@ -7,3 +7,3 @@ var C = require('..'); | ||
if (err) throw err; | ||
var buffer = C.compress(data); | ||
var buffer = C.option('-v -bit_depth 8').compress(data); | ||
fs.writeFile('./alphatest_out.png', buffer, { | ||
@@ -10,0 +10,0 @@ flags: 'wb' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
4226062
71
97
0
4
5