advpng-bin
Advanced tools
Comparing version 5.0.2 to 6.0.0
#!/usr/bin/env node | ||
'use strict'; | ||
const {spawn} = require('child_process'); | ||
const advpng = require('.'); | ||
import {spawn} from 'node:child_process'; | ||
import process from 'node:process'; | ||
import advpng from './index.js'; | ||
@@ -6,0 +6,0 @@ const input = process.argv.slice(2); |
@@ -1,2 +0,3 @@ | ||
'use strict'; | ||
module.exports = require('./lib').path(); | ||
import lib from './lib/index.js'; | ||
export default lib.path(); |
@@ -1,13 +0,16 @@ | ||
'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.github.com/imagemin/advpng-bin/v${pkg.version}/vendor/`; | ||
module.exports = new BinWrapper() | ||
const binWrapper = new BinWrapper() | ||
.src(`${url}osx/advpng`, 'darwin') | ||
.src(`${url}linux/advpng`, 'linux') | ||
.src(`${url}win32/advpng.exe`, 'win32') | ||
.dest(path.resolve(__dirname, '../vendor')) | ||
.dest(fileURLToPath(new URL('../vendor', import.meta.url))) | ||
.use(process.platform === 'win32' ? 'advpng.exe' : 'advpng'); | ||
export default binWrapper; |
@@ -1,5 +0,4 @@ | ||
'use strict'; | ||
const path = require('path'); | ||
const binBuild = require('bin-build'); | ||
const bin = require('.'); | ||
import {fileURLToPath} from 'node:url'; | ||
import binBuild from 'bin-build'; | ||
import bin from './index.js'; | ||
@@ -12,6 +11,8 @@ (async () => { | ||
await binBuild.file(path.resolve(__dirname, '../vendor/source/advancecomp-2.1.tar.gz'), [ | ||
const source = fileURLToPath(new URL('../vendor/source/advancecomp-2.1.tar.gz', import.meta.url)); | ||
await binBuild.file(source, [ | ||
'autoreconf -fiv', | ||
`./configure --prefix="${bin.dest()}" --bindir="${bin.dest()}"`, | ||
'make install' | ||
'make install', | ||
]).then(() => { | ||
@@ -18,0 +19,0 @@ console.log('advpng built successfully'); |
{ | ||
"name": "advpng-bin", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"description": "AdvPNG bin-wrapper that makes it seamlessly available as a local dependency", | ||
"license": "MIT", | ||
"repository": "imagemin/advpng-bin", | ||
"type": "module", | ||
"author": { | ||
"name": "1000ch", | ||
"email": "shogo.sensui@gmail.com", | ||
"name": "Shogo Sensui", | ||
"email": "shogosensui@gmail.com", | ||
"web": "github.com/1000ch" | ||
@@ -32,3 +33,3 @@ }, | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -60,9 +61,9 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "^3.8.0", | ||
"ava": "^3.15.0", | ||
"bin-check": "^4.1.0", | ||
"compare-size": "^3.0.0", | ||
"execa": "^4.0.0", | ||
"tempy": "^0.5.0", | ||
"xo": "^0.30.0" | ||
"execa": "^5.1.1", | ||
"tempy": "^2.0.0", | ||
"xo": "^0.45.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# advpng-bin | ||
# advpng-bin ![GitHub Actions Status](https://github.com/imagemin/advpng-bin/workflows/test/badge.svg?branch=main) | ||
@@ -16,6 +16,6 @@ > The main purpose of this utility is to recompress png files to get the smallest possible size | ||
```js | ||
const {execFile} = require('child_process'); | ||
const advpng = require('advpng-bin'); | ||
import {execFile} from 'node:child_process'; | ||
import advpng from 'advpng-bin'; | ||
execFile(advpng, ['--recompress', '--shrink-extra', 'image.png'], err => { | ||
execFile(advpng, ['--recompress', '--shrink-extra', 'image.png'], error => { | ||
console.log('Image minified!'); | ||
@@ -22,0 +22,0 @@ }); |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
1199520
43
1
Yes