Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jpegtran-bin

Package Overview
Dependencies
Maintainers
3
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jpegtran-bin - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

pre-build.js

52

build.js

@@ -8,34 +8,36 @@ 'use strict';

which('make', function (err) {
if (err) {
return console.log(err.red);
}
module.exports = function () {
if (process.platform === 'darwin' || process.platform === 'linux') {
var binDir = path.dirname(binPath);
var configureFlags = '--disable-shared ';
which('make', function (err) {
if (err) {
return console.log(err);
}
if (process.platform === 'darwin') {
configureFlags += '--host i686-apple-darwin ';
}
var binDir = path.dirname(binPath);
var configureFlags = '--disable-shared ';
if (process.platform === 'linux' && process.arch === 'x64') {
configureFlags += 'CFLAGS=\'-O3 -m64\' LDFLAGS=-m64';
} else {
configureFlags += 'CFLAGS=\'-O3 -m32\' LDFLAGS=-m32';
}
if (process.platform === 'darwin') {
configureFlags += '--host i686-apple-darwin ';
}
var buildScript = './configure ' + configureFlags + ' &&' +
'make install prefix=' + __dirname +
'/libjpeg-turbo/ bindir=' + binDir +
' bin_PROGRAMS=jpegtran';
exec(buildScript, { cwd: './libjpeg-turbo/' }, function (err) {
if (err) {
return console.log(err);
if (process.platform === 'linux' && process.arch === 'x64') {
configureFlags += 'CFLAGS=\'-O3 -m64\' LDFLAGS=-m64';
} else {
configureFlags += 'CFLAGS=\'-O3 -m32\' LDFLAGS=-m32';
}
console.log('libjpeg-turbo rebuilt successfully'.green);
var buildScript = './configure ' + configureFlags + ' &&' +
'make install prefix=' + __dirname +
'/libjpeg-turbo/ bindir=' + binDir +
' bin_PROGRAMS=jpegtran';
exec(buildScript, { cwd: './libjpeg-turbo/' }, function (err) {
if (err) {
return console.log(err);
}
console.log('libjpeg-turbo rebuilt successfully'.green);
});
});
}
});
};
{
"name": "jpegtran-bin",
"version": "0.1.3",
"version": "0.1.4",
"description": "jpegtran (part of libjpeg-turbo) wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows. Most commonly used to losslessly minify JPEG images.",

@@ -21,2 +21,7 @@ "keywords": [

},
"maintainers": [
{
"name": "Duncan Wong"
}
],
"main": "lib/jpegtran-bin.js",

@@ -29,4 +34,4 @@ "bin": "bin/jpegtran-bin",

"scripts": {
"test": "mocha test/test-*.js",
"postinstall": "node build.js"
"test": "mocha",
"postinstall": "node pre-build.js"
},

@@ -43,7 +48,5 @@ "engines": {

"colors": "~0.6.0",
"which": "~1.0.5"
},
"devDependencies": {
"mocha": "~1.6.0"
"which": "~1.0.5",
"mocha": "~1.9.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