node-pngcrush
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -20,3 +20,5 @@ var _handle = require('./scripts/util/binding.js')(); | ||
if (cb) this._callback = cb; | ||
if (process.versions.node >= '4.0.0') { | ||
if (process.versions.node >= '10.0.0') { | ||
out = (new _handle.Pngcrush(buffer, this._option)).compress(); | ||
} else if (process.versions.node >= '4.0.0') { | ||
out = new _handle(buffer, this._option).compress(); | ||
@@ -23,0 +25,0 @@ } else { |
{ | ||
"name": "node-pngcrush", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The node-pngcrush is an addon of node, as a readable/writable stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,8 @@ /*! | ||
module.exports = function() { | ||
if (!extensions.hasBinary(extensions.getBinaryPath())) { | ||
var binaryPath; | ||
if (extensions.hasBinary(extensions.getBuildBinaryPath())) { | ||
return require(extensions.getBuildBinaryPath()); | ||
} | ||
if (!extensions.hasBinary(binaryPath = extensions.getBinaryPath())) { | ||
if (!extensions.isSupportedEnvironment()) { | ||
@@ -14,0 +19,0 @@ throw new Error(errors.unsupportedEnvironment()); |
@@ -44,3 +44,3 @@ /*! | ||
'Missing binding ' + extensions.getBinaryPath(), | ||
pkg.name + 'could not find a binding for your current environment: ' + humanEnvironment(), | ||
pkg.name + ' could not find a binding for your current environment: ' + humanEnvironment(), | ||
'', | ||
@@ -47,0 +47,0 @@ foundBinaries(), |
@@ -79,2 +79,3 @@ /*! | ||
case 57: return 'Node.js 8.x'; | ||
case 64: return 'Node.js 10.x'; | ||
default: return false; | ||
@@ -281,2 +282,12 @@ } | ||
function getBuildBinaryPath() { | ||
var env = process.env['NODE_DEBUG'] === 'dev' ? 'Debug' : 'Release'; | ||
return path.resolve( | ||
path.dirname(__dirname), | ||
'..', | ||
'build', | ||
env, | ||
'binding.node' | ||
); | ||
} | ||
/** | ||
@@ -413,2 +424,3 @@ * An array of paths suitable for use as a local disk cache of the binding. | ||
module.exports.getBinaryPath = getBinaryPath; | ||
module.exports.getBuildBinaryPath = getBuildBinaryPath; | ||
module.exports.getBinaryCachePath = getBinaryCachePath; | ||
@@ -415,0 +427,0 @@ module.exports.getCachedBinary = getCachedBinary; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23480
685
0
19