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

gifsicle

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gifsicle - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

3

bin/gifsicle.js
#!/usr/bin/env node
'use strict';
var binPath = require('../lib/gifsicle').path;
var spawn = require('child_process').spawn;
var binPath = require('../lib/gifsicle').path;
spawn(binPath, process.argv.slice(2), { stdio: 'inherit' })
.on('exit', process.exit);
'use strict';
var fs = require('fs');
var path = require('path');
var bin = require('./gifsicle').bin;
var chalk = require('chalk');
var Mocha = require('mocha');
var mocha = new Mocha({ui: 'bdd', reporter: 'min'});
var util = require('./util');
var bin = require('./gifsicle');
function runBuild() {
return util.build(bin.src, path.dirname(bin.path), function (err) {
if (err) {
return console.log(chalk.red('✗ %s'), err.message);
bin.check(function (w) {
if (!w) {
console.log(chalk.red('✗ pre-build test failed, compiling from source...'));
if (process.platform === 'win32') {
throw new Error('building is not supported on ' + process.platform);
}
console.log(chalk.green('✓ gifsicle rebuilt successfully'));
});
}
return bin.build(function (err) {
if (err) {
return console.log(chalk.red('✗ ' + err.message));
}
function runTest() {
mocha.addFile('test/test-gifsicle-path.js');
mocha.run(function (failures) {
if (failures > 0) {
console.log(chalk.red('✗ pre-build test failed, compiling from source...'));
runBuild();
} else {
console.log(chalk.green('✓ pre-build test passed successfully, skipping build...'));
}
});
}
console.log(chalk.green('✓ gifsicle rebuilt successfully'));
});
}
if (fs.existsSync(bin.path)) {
runTest();
} else {
util.fetch(bin.url, bin.path, function (err) {
if (err) {
return console.log(chalk.red('✗ %s'), err.message);
}
fs.chmod(bin.path, '0755');
runTest();
});
}
console.log(chalk.green('✓ pre-build test passed successfully'));
});
'use strict';
var Bin = require('bin-wrapper');
var path = require('path');
var url = require('url');
var target = {
var options = {
name: 'gifsicle',
url: 'https://raw.github.com/yeoman/node-gifsicle/master/',
bin: 'gifsicle',
path: path.join(__dirname, '../vendor'),
src: 'http://www.lcdf.org/gifsicle/gifsicle-1.71.tar.gz',
pathPrefix: '../vendor',
urlPrefix: 'vendor',
platforms: {
buildScript: './configure --disable-gifview --disable-gifdiff ' +
'--bindir="' + path.join(__dirname, '../vendor') + '" && ' +
'make install',
platform: {
darwin: {
path: 'osx'
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/osx/gifsicle'
},
linux: {
path: 'linux',
arch: true
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/linux/x86/gifsicle',
arch: {
x64: {
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/linux/x64/gifsicle'
}
}
},
freebsd: {
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/freebsd/x86/gifsicle',
arch: {
x64: {
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/freebsd/x64/gifsicle'
}
}
},
win32: {
path: 'win',
arch: true,
suffix: 'exe'
},
freebsd: {
path: 'freebsd',
arch: true
bin: 'gifsicle.exe',
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/win/x86/gifsicle.exe',
arch: {
x64: {
url: 'https://raw.github.com/yeoman/node-gifsicle/master/vendor/win/x64/gifsicle.exe'
}
}
}
}
};
var bin = new Bin(options);
function getPathToPackagedBinary(target, options) {
var platform = target.platforms[process.platform];
if (platform === undefined) {
return console.error('Unsupported platform:', process.platform, process.arch);
}
options = options || {};
options.url = options.url || false;
var targetPath = [];
var targetPrefix = target.pathPrefix;
var arch = process.arch === 'x64' ? 'x64' : 'x86';
var exec = target.name;
if (options.url) {
targetPrefix = target.urlPrefix;
}
targetPath.push(targetPrefix);
if (options.url) {
targetPath.push(platform.path);
} else {
targetPath.unshift(__dirname);
}
if (options.url && platform.arch === true) {
targetPath.push(arch);
}
if (platform.suffix !== undefined) {
exec += '.' + platform.suffix;
}
targetPath.push(exec);
if (options.url) {
return url.resolve(target.url, targetPath.join('/'));
} else {
return path.join.apply(__dirname, targetPath);
}
}
exports.path = getPathToPackagedBinary(target);
exports.url = getPathToPackagedBinary(target, { url: true });
exports.src = target.src;
exports.bin = bin;
exports.options = options;
exports.path = bin.path;
{
"name": "gifsicle",
"version": "0.1.3",
"version": "0.1.4",
"description": "gifsicle wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows",

@@ -31,10 +31,8 @@ "keywords": [

"dependencies": {
"which": "~1.0.5",
"mocha": "~1.12.0",
"tar": "~0.1.17",
"request": "~2.25.0",
"request-progress": "~0.2.1",
"chalk": "~0.2.0",
"mkdirp": "~0.3.5"
"bin-wrapper": "~0.1.3",
"chalk": "~0.2.0"
},
"devDependencies": {
"mocha": "~1.13.0"
},
"engines": {

@@ -45,5 +43,4 @@ "node": ">=0.8.0"

"bin",
"lib",
"test"
"lib"
]
}
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