first commit
This commit is contained in:
8
build/node_modules/optipng-bin/cli.js
generated
vendored
Executable file
8
build/node_modules/optipng-bin/cli.js
generated
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
var spawn = require('child_process').spawn;
|
||||
var optipng = require('./');
|
||||
var input = process.argv.slice(2);
|
||||
|
||||
spawn(optipng, input, {stdio: 'inherit'})
|
||||
.on('exit', process.exit);
|
||||
2
build/node_modules/optipng-bin/index.js
generated
vendored
Normal file
2
build/node_modules/optipng-bin/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./lib').path();
|
||||
17
build/node_modules/optipng-bin/lib/index.js
generated
vendored
Normal file
17
build/node_modules/optipng-bin/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var BinWrapper = require('bin-wrapper');
|
||||
var pkg = require('../package.json');
|
||||
var url = 'https://raw.githubusercontent.com/imagemin/optipng-bin/v' + pkg.version + '/vendor/';
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(url + 'macos/optipng', 'darwin')
|
||||
.src(url + 'linux/x86/optipng', 'linux', 'x86')
|
||||
.src(url + 'linux/x64/optipng', 'linux', 'x64')
|
||||
.src(url + 'freebsd/x86/optipng', 'freebsd', 'x86')
|
||||
.src(url + 'freebsd/x64/optipng', 'freebsd', 'x64')
|
||||
.src(url + 'sunos/x86/optipng', 'sunos', 'x86')
|
||||
.src(url + 'sunos/x64/optipng', 'sunos', 'x64')
|
||||
.src(url + 'win/optipng.exe', 'win32')
|
||||
.dest(path.join(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'optipng.exe' : 'optipng');
|
||||
32
build/node_modules/optipng-bin/lib/install.js
generated
vendored
Normal file
32
build/node_modules/optipng-bin/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
'use strict';
|
||||
var BinBuild = require('bin-build');
|
||||
var log = require('logalot');
|
||||
var bin = require('./');
|
||||
|
||||
bin.run(function (err) {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('optipng pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
new BinBuild()
|
||||
.src('https://downloads.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.6/optipng-0.7.6.tar.gz')
|
||||
.cmd([
|
||||
'./configure --with-system-zlib --prefix="' + bin.dest() + '"',
|
||||
'--bindir="' + bin.dest() + '"'
|
||||
].join(' '))
|
||||
.cmd('make install')
|
||||
.run(function (err) {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('optipng built successfully');
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('optipng pre-build test passed successfully');
|
||||
});
|
||||
21
build/node_modules/optipng-bin/license
generated
vendored
Normal file
21
build/node_modules/optipng-bin/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) imagemin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
92
build/node_modules/optipng-bin/package.json
generated
vendored
Normal file
92
build/node_modules/optipng-bin/package.json
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"_from": "optipng-bin@^3.0.0",
|
||||
"_id": "optipng-bin@3.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-ldNPLEiHBPb9cGBr/qDGWfHZXYQ=",
|
||||
"_location": "/optipng-bin",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "optipng-bin@^3.0.0",
|
||||
"name": "optipng-bin",
|
||||
"escapedName": "optipng-bin",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/imagemin-optipng"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/optipng-bin/-/optipng-bin-3.1.4.tgz",
|
||||
"_shasum": "95d34f2c488704f6fd70606bfea0c659f1d95d84",
|
||||
"_spec": "optipng-bin@^3.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/imagemin-optipng",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bin": {
|
||||
"optipng": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/imagemin/optipng-bin/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"bin-build": "^2.0.0",
|
||||
"bin-wrapper": "^3.0.0",
|
||||
"logalot": "^2.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "OptiPNG wrapper that makes it seamlessly available as a local dependency",
|
||||
"devDependencies": {
|
||||
"bin-check": "^1.0.0",
|
||||
"compare-size": "^1.0.1",
|
||||
"mkdirp": "^0.5.0",
|
||||
"mocha": "^2.2.4",
|
||||
"path-exists": "^1.0.0",
|
||||
"rimraf": "^2.3.2",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"cli.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/imagemin/optipng-bin#readme",
|
||||
"keywords": [
|
||||
"compress",
|
||||
"image",
|
||||
"img",
|
||||
"minify",
|
||||
"optimize",
|
||||
"png"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
{
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"url": "github.com/shinnn"
|
||||
}
|
||||
],
|
||||
"name": "optipng-bin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/imagemin/optipng-bin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node lib/install.js",
|
||||
"test": "xo && mocha --timeout 50000"
|
||||
},
|
||||
"version": "3.1.4"
|
||||
}
|
||||
38
build/node_modules/optipng-bin/readme.md
generated
vendored
Normal file
38
build/node_modules/optipng-bin/readme.md
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
# optipng-bin [](https://travis-ci.org/imagemin/optipng-bin)
|
||||
|
||||
> [OptiPNG](http://optipng.sourceforge.net) is a PNG optimizer that recompresses image files to a smaller size, without losing any information
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save optipng-bin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const {execFile} = require('child_process');
|
||||
const optipng = require('optipng-bin');
|
||||
|
||||
execFile(optipng, ['-out', 'output.png', 'input.png'], err => {
|
||||
console.log('Image minified!');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```
|
||||
$ npm install --global optipng-bin
|
||||
```
|
||||
|
||||
```
|
||||
$ optipng --help
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [imagemin](https://github.com/imagemin)
|
||||
BIN
build/node_modules/optipng-bin/vendor/optipng
generated
vendored
Executable file
BIN
build/node_modules/optipng-bin/vendor/optipng
generated
vendored
Executable file
Binary file not shown.
Reference in New Issue
Block a user