gifsicle
Advanced tools
Comparing version 5.2.1 to 6.0.0
#!/usr/bin/env node | ||
'use strict'; | ||
const execa = require('execa'); | ||
const m = require('.'); | ||
import process from 'node:process'; | ||
import execa from 'execa'; | ||
import gifsicle from './index.js'; | ||
execa(m, process.argv.slice(2), {stdio: 'inherit'}); | ||
execa(gifsicle, process.argv.slice(2), {stdio: 'inherit'}); |
@@ -1,2 +0,3 @@ | ||
'use strict'; | ||
module.exports = require('./lib').path(); /* eslint-disable-line import/extensions */ | ||
import lib from './lib/index.js'; | ||
export default lib.path(); |
@@ -1,9 +0,10 @@ | ||
'use strict'; | ||
const path = require('path'); | ||
const BinWrapper = require('bin-wrapper'); | ||
const pkg = require('../package.json'); | ||
import fs from 'node:fs'; | ||
import process from 'node:process'; | ||
import {fileURLToPath} from 'node:url'; | ||
import BinWrapper from 'bin-wrapper'; | ||
const pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url))); | ||
const url = `https://raw.githubusercontent.com/imagemin/gifsicle-bin/v${pkg.version}/vendor/`; | ||
module.exports = new BinWrapper() | ||
const binWrapper = new BinWrapper() | ||
.src(`${url}macos/gifsicle`, 'darwin') | ||
@@ -16,3 +17,5 @@ .src(`${url}linux/x86/gifsicle`, 'linux', 'x86') | ||
.src(`${url}win/x64/gifsicle.exe`, 'win32', 'x64') | ||
.dest(path.join(__dirname, '../vendor')) | ||
.dest(fileURLToPath(new URL('../vendor', import.meta.url))) | ||
.use(process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle'); | ||
export default binWrapper; |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
const path = require('path'); | ||
const binBuild = require('bin-build'); | ||
const bin = require('.'); | ||
import process from 'node:process'; | ||
import {fileURLToPath} from 'node:url'; | ||
import binBuild from 'bin-build'; | ||
import bin from './index.js'; | ||
@@ -17,10 +17,11 @@ (async () => { | ||
'./configure --disable-gifview --disable-gifdiff', | ||
`--prefix="${bin.dest()}" --bindir="${bin.dest()}"` | ||
`--prefix="${bin.dest()}" --bindir="${bin.dest()}"`, | ||
].join(' '); | ||
try { | ||
await binBuild.file(path.resolve(__dirname, '../vendor/source/gifsicle-1.92.tar.gz'), [ | ||
const source = fileURLToPath(new URL('../vendor/source/gifsicle-1.93.tar.gz', import.meta.url)); | ||
await binBuild.file(source, [ | ||
'autoreconf -ivf', | ||
config, | ||
'make install' | ||
'make install', | ||
]); | ||
@@ -27,0 +28,0 @@ |
{ | ||
"name": "gifsicle", | ||
"version": "5.2.1", | ||
"version": "6.0.0", | ||
"description": "gifsicle wrapper that makes it seamlessly available as a local dependency", | ||
"license": "MIT", | ||
"repository": "imagemin/gifsicle-bin", | ||
"type": "module", | ||
"funding": { | ||
@@ -14,3 +15,3 @@ "url": "https://github.com/imagemin/gisicle-bin?sponsor=1" | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -40,3 +41,3 @@ "scripts": { | ||
"bin-wrapper": "^4.0.0", | ||
"execa": "^5.0.0" | ||
"execa": "^5.1.1" | ||
}, | ||
@@ -47,5 +48,5 @@ "devDependencies": { | ||
"compare-size": "^3.0.0", | ||
"tempy": "^1.0.0", | ||
"xo": "^0.38.1" | ||
"tempy": "^2.0.0", | ||
"xo": "^0.45.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# gifsicle-bin | ||
# gifsicle-bin ![GitHub Actions Status](https://github.com/imagemin/gifsicle-bin/workflows/test/badge.svg?branch=main) | ||
@@ -16,6 +16,6 @@ > gifsicle manipulates GIF image files in many different ways. Depending on command line options, it can merge several GIFs into a GIF animation; explode an animation into its component frames; change individual frames in an animation; turn interlacing on and off; add transparency and much more. | ||
```js | ||
const {execFile} = require('child_process'); | ||
const gifsicle = require('gifsicle'); | ||
import {execFile} from 'node:child_process'; | ||
import gifsicle from 'gifsicle'; | ||
execFile(gifsicle, ['-o', 'output.gif', 'input.gif'], err => { | ||
execFile(gifsicle, ['-o', 'output.gif', 'input.gif'], error => { | ||
console.log('Image minified!'); | ||
@@ -22,0 +22,0 @@ }); |
55
Yes
484302
Updatedexeca@^5.1.1