first commit
This commit is contained in:
9
build/node_modules/pngcrush-bin/cli.js
generated
vendored
Executable file
9
build/node_modules/pngcrush-bin/cli.js
generated
vendored
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
const spawn = require('child_process').spawn;
|
||||
const pngcrush = require('.');
|
||||
|
||||
const input = process.argv.slice(2);
|
||||
|
||||
spawn(pngcrush, input, {stdio: 'inherit'})
|
||||
.on('exit', process.exit);
|
||||
2
build/node_modules/pngcrush-bin/index.js
generated
vendored
Normal file
2
build/node_modules/pngcrush-bin/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = require('./lib').path();
|
||||
14
build/node_modules/pngcrush-bin/lib/index.js
generated
vendored
Normal file
14
build/node_modules/pngcrush-bin/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const BinWrapper = require('bin-wrapper');
|
||||
const pkg = require('../package.json');
|
||||
|
||||
const url = `https://raw.githubusercontent.com/imagemin/pngcrush-bin/v${pkg.version}/vendor/`;
|
||||
|
||||
module.exports = new BinWrapper()
|
||||
.src(`${url}osx/pngcrush`, 'darwin')
|
||||
.src(`${url}linux/pngcrush`, 'linux')
|
||||
.src(`${url}win/x64/pngcrush.exe`, 'win32', 'x64')
|
||||
.src(`${url}win/x86/pngcrush.exe`, 'win32', 'x86')
|
||||
.dest(path.resolve(__dirname, '../vendor'))
|
||||
.use(process.platform === 'win32' ? 'pngcrush.exe' : 'pngcrush');
|
||||
28
build/node_modules/pngcrush-bin/lib/install.js
generated
vendored
Normal file
28
build/node_modules/pngcrush-bin/lib/install.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
const BinBuild = require('bin-build');
|
||||
const log = require('logalot');
|
||||
const bin = require('.');
|
||||
|
||||
bin.run(['-version'], err => {
|
||||
if (err) {
|
||||
log.warn(err.message);
|
||||
log.warn('pngcrush pre-build test failed');
|
||||
log.info('compiling from source');
|
||||
|
||||
const builder = new BinBuild()
|
||||
.src('https://downloads.sourceforge.net/project/pmt/pngcrush/1.8.13/pngcrush-1.8.13.zip')
|
||||
.cmd(`mkdir -p ${bin.dest()}`)
|
||||
.cmd(`make && mv ${bin.use()} ${bin.path()}`);
|
||||
|
||||
return builder.run(err => {
|
||||
if (err) {
|
||||
log.error(err.stack);
|
||||
return;
|
||||
}
|
||||
|
||||
log.success('pngcrush built successfully');
|
||||
});
|
||||
}
|
||||
|
||||
log.success('pngcrush pre-build test passed successfully');
|
||||
});
|
||||
21
build/node_modules/pngcrush-bin/license
generated
vendored
Normal file
21
build/node_modules/pngcrush-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.
|
||||
100
build/node_modules/pngcrush-bin/package.json
generated
vendored
Normal file
100
build/node_modules/pngcrush-bin/package.json
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"_from": "pngcrush-bin@^3.0.0",
|
||||
"_id": "pngcrush-bin@3.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Sb60BVQpIKYRaVVCQ7ZIMAuA4kOFJKj4AeC8KSyVcgSCRNszh+pc87sCTi30WyvxVKsKtSXJNQP4K9sONGxr7Q==",
|
||||
"_location": "/pngcrush-bin",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "pngcrush-bin@^3.0.0",
|
||||
"name": "pngcrush-bin",
|
||||
"escapedName": "pngcrush-bin",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/imagemin-pngcrush"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/pngcrush-bin/-/pngcrush-bin-3.1.1.tgz",
|
||||
"_shasum": "cdd6e638f7b3cada6d728901d02b5a2b85126436",
|
||||
"_spec": "pngcrush-bin@^3.0.0",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/imagemin-pngcrush",
|
||||
"author": {
|
||||
"name": "1000ch",
|
||||
"email": "shogo.sensui@gmail.com",
|
||||
"url": "github.com/1000ch"
|
||||
},
|
||||
"bin": {
|
||||
"pngcrush": "cli.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/imagemin/pngcrush-bin/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"bin-build": "^2.2.0",
|
||||
"bin-wrapper": "^3.0.0",
|
||||
"logalot": "^2.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "pngcrush wrapper that makes it seamlessly available as a local dependency",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"bin-check": "^4.0.1",
|
||||
"compare-size": "^3.0.0",
|
||||
"execa": "^0.6.3",
|
||||
"tempy": "^0.1.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"cli.js",
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/imagemin/pngcrush-bin#readme",
|
||||
"keywords": [
|
||||
"imagemin",
|
||||
"bin",
|
||||
"binary",
|
||||
"compress",
|
||||
"image",
|
||||
"img",
|
||||
"minify",
|
||||
"optimize",
|
||||
"png",
|
||||
"pngcrush"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Mårtensson",
|
||||
"email": "kevinmartensson@gmail.com",
|
||||
"url": "github.com/kevva"
|
||||
},
|
||||
{
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"url": "github.com/shinnn"
|
||||
}
|
||||
],
|
||||
"name": "pngcrush-bin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/imagemin/pngcrush-bin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node lib/install.js",
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "3.1.1"
|
||||
}
|
||||
40
build/node_modules/pngcrush-bin/readme.md
generated
vendored
Normal file
40
build/node_modules/pngcrush-bin/readme.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
# pngcrush-bin [](https://travis-ci.org/imagemin/pngcrush-bin)
|
||||
|
||||
> [pngcrush](https://pmt.sourceforge.io/pngcrush/) is an optimizer which main purpose is to reduce the size of the PNG IDAT datastream by trying various compression levels an PNG filter methods
|
||||
|
||||
You probably want [`imagemin-pngcrush`](https://github.com/imagemin/imagemin-pngcrush) instead.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save pngcrush-bin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const {execFile} = require('child_process');
|
||||
const pngcrush = require('pngcrush-bin');
|
||||
|
||||
execFile(pngcrush, ['-reduce', '-brute', 'input.png', 'output.png'], err => {
|
||||
console.log('Image minified');
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
## CLI
|
||||
|
||||
```
|
||||
$ npm install --global pngcrush-bin
|
||||
```
|
||||
|
||||
```
|
||||
$ pngcrush --help
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Imagemin](https://github.com/imagemin)
|
||||
BIN
build/node_modules/pngcrush-bin/vendor/pngcrush
generated
vendored
Executable file
BIN
build/node_modules/pngcrush-bin/vendor/pngcrush
generated
vendored
Executable file
Binary file not shown.
Reference in New Issue
Block a user