jpegtran-bin
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -18,3 +18,3 @@ 'use strict'; | ||
log.success('jpegtran pre-build test passed successfully'); | ||
}).catch(error => { | ||
}).catch(async error => { | ||
log.warn(error.message); | ||
@@ -29,11 +29,13 @@ log.warn('jpegtran pre-build test failed'); | ||
binBuild.url('https://downloads.sourceforge.net/project/libjpeg-turbo/1.5.1/libjpeg-turbo-1.5.1.tar.gz', [ | ||
'touch configure.ac aclocal.m4 configure Makefile.am Makefile.in', | ||
cfg, | ||
'make install' | ||
]).then(() => { | ||
try { | ||
await binBuild.file(path.resolve(__dirname, '../vendor/source/libjpeg-turbo-1.5.1.tar.gz'), [ | ||
'touch configure.ac aclocal.m4 configure Makefile.am Makefile.in', | ||
cfg, | ||
'make install' | ||
]); | ||
log.success('jpegtran built successfully'); | ||
}).catch(error => { | ||
} catch (error) { | ||
log.error(error.stack); | ||
}); | ||
} | ||
}); |
{ | ||
"name": "jpegtran-bin", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "jpegtran (part of libjpeg-turbo) bin-wrapper that makes it seamlessly available as a local dependency", | ||
@@ -27,7 +27,7 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"postinstall": "node lib/install.js", | ||
"test": "xo && ava" | ||
"test": "xo && ava --timeout=120s" | ||
}, | ||
@@ -57,9 +57,9 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "*", | ||
"ava": "^3.8.0", | ||
"bin-check": "^4.0.1", | ||
"compare-size": "^3.0.0", | ||
"execa": "^1.0.0", | ||
"tempy": "^0.2.1", | ||
"xo": "*" | ||
"execa": "^4.0.0", | ||
"tempy": "^0.5.0", | ||
"xo": "^0.30.0" | ||
} | ||
} |
@@ -18,6 +18,6 @@ # jpegtran-bin [![Build Status](https://travis-ci.org/imagemin/jpegtran-bin.svg?branch=master)](https://travis-ci.org/imagemin/jpegtran-bin) | ||
```js | ||
var execFile = require('child_process').execFile; | ||
var jpegtran = require('jpegtran-bin'); | ||
const {execFile} = require('child_process'); | ||
const jpegtran = require('jpegtran-bin'); | ||
execFile(jpegtran, ['-outfile', 'output.jpg', 'input.jpg'], function (err) { | ||
execFile(jpegtran, ['-outfile', 'output.jpg', 'input.jpg'], error => { | ||
console.log('Image minified!'); | ||
@@ -24,0 +24,0 @@ }); |
@@ -13,6 +13,6 @@ 'use strict'; | ||
test('rebuild the jpegtran binaries', async t => { | ||
const tmp = tempy.directory(); | ||
const temporary = tempy.directory(); | ||
const cfg = [ | ||
'./configure --disable-shared', | ||
`--prefix="${tmp}" --bindir="${tmp}"` | ||
`--prefix="${temporary}" --bindir="${temporary}"` | ||
].join(' '); | ||
@@ -25,3 +25,3 @@ | ||
t.true(fs.existsSync(path.join(tmp, 'jpegtran'))); | ||
t.true(fs.existsSync(path.join(temporary, 'jpegtran'))); | ||
}); | ||
@@ -34,5 +34,5 @@ | ||
test('minify a JPG', async t => { | ||
const tmp = tempy.directory(); | ||
const temporary = tempy.directory(); | ||
const src = path.join(__dirname, 'fixtures/test.jpg'); | ||
const dest = path.join(tmp, 'test.jpg'); | ||
const dest = path.join(temporary, 'test.jpg'); | ||
const args = [ | ||
@@ -45,5 +45,5 @@ '-outfile', | ||
await execa(jpegtran, args); | ||
const res = await compareSize(src, dest); | ||
const result = await compareSize(src, dest); | ||
t.true(res[dest] < res[src]); | ||
t.true(result[dest] < result[src]); | ||
}); |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9746
100
1