diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
commit | abd94a7f5a50f43c797a11b53549ae48fff667c3 (patch) | |
tree | ab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/gulp-zip | |
parent | a0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff) | |
download | wallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz |
add node_modules to address #4364
Diffstat (limited to 'node_modules/gulp-zip')
-rw-r--r-- | node_modules/gulp-zip/index.js | 74 | ||||
-rw-r--r-- | node_modules/gulp-zip/license | 21 | ||||
-rw-r--r-- | node_modules/gulp-zip/package.json | 115 | ||||
-rw-r--r-- | node_modules/gulp-zip/readme.md | 47 |
4 files changed, 257 insertions, 0 deletions
diff --git a/node_modules/gulp-zip/index.js b/node_modules/gulp-zip/index.js new file mode 100644 index 000000000..82733be43 --- /dev/null +++ b/node_modules/gulp-zip/index.js @@ -0,0 +1,74 @@ +'use strict'; +var path = require('path'); +var gutil = require('gulp-util'); +var through = require('through2'); +var chalk = require('chalk'); +var Yazl = require('yazl'); +var concatStream = require('concat-stream'); + +module.exports = function (filename, opts) { + if (!filename) { + throw new gutil.PluginError('gulp-zip', chalk.blue('filename') + ' required'); + } + + opts = opts || {}; + opts.compress = typeof opts.compress === 'boolean' ? opts.compress : true; + + var firstFile; + var zip = new Yazl.ZipFile(); + + return through.obj(function (file, enc, cb) { + if (!firstFile) { + firstFile = file; + } + + // because Windows... + var pathname = file.relative.replace(/\\/g, '/'); + + if (!pathname) { + cb(); + return; + } + + if (file.isNull() && file.stat && file.stat.isDirectory && file.stat.isDirectory()) { + zip.addEmptyDirectory(pathname, { + mtime: file.stat.mtime || new Date(), + mode: file.stat.mode + }); + } else { + var stat = { + compress: opts.compress, + mtime: file.stat ? file.stat.mtime : new Date(), + mode: file.stat ? file.stat.mode : null + }; + + if (file.isStream()) { + zip.addReadStream(file.contents, pathname, stat); + } + + if (file.isBuffer()) { + zip.addBuffer(file.contents, pathname, stat); + } + } + + cb(); + }, function (cb) { + if (!firstFile) { + cb(); + return; + } + + zip.end(function () { + zip.outputStream.pipe(concatStream(function (data) { + this.push(new gutil.File({ + cwd: firstFile.cwd, + base: firstFile.base, + path: path.join(firstFile.base, filename), + contents: data + })); + + cb(); + }.bind(this))); + }.bind(this)); + }); +}; diff --git a/node_modules/gulp-zip/license b/node_modules/gulp-zip/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/gulp-zip/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +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. diff --git a/node_modules/gulp-zip/package.json b/node_modules/gulp-zip/package.json new file mode 100644 index 000000000..d774276bd --- /dev/null +++ b/node_modules/gulp-zip/package.json @@ -0,0 +1,115 @@ +{ + "_args": [ + [ + { + "raw": "gulp-zip@^3.1.0", + "scope": null, + "escapedName": "gulp-zip", + "name": "gulp-zip", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex" + ] + ], + "_from": "gulp-zip@>=3.1.0 <4.0.0", + "_id": "gulp-zip@3.2.0", + "_inCache": true, + "_location": "/gulp-zip", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/gulp-zip-3.2.0.tgz_1455727440938_0.7831456253770739" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "raw": "gulp-zip@^3.1.0", + "scope": null, + "escapedName": "gulp-zip", + "name": "gulp-zip", + "rawSpec": "^3.1.0", + "spec": ">=3.1.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "#DEV:/" + ], + "_resolved": "https://registry.npmjs.org/gulp-zip/-/gulp-zip-3.2.0.tgz", + "_shasum": "ebd198dae6dc2d5f44d814569c8ec42118a93ef9", + "_shrinkwrap": null, + "_spec": "gulp-zip@^3.1.0", + "_where": "/home/dold/repos/taler/wallet-webex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/gulp-zip/issues" + }, + "dependencies": { + "chalk": "^1.0.0", + "concat-stream": "^1.4.7", + "gulp-util": "^3.0.0", + "through2": "^2.0.1", + "yazl": "^2.1.0" + }, + "description": "ZIP compress files", + "devDependencies": { + "decompress-unzip": "*", + "gulp": "*", + "mocha": "*", + "vinyl-assign": "*", + "vinyl-file": "^2.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ebd198dae6dc2d5f44d814569c8ec42118a93ef9", + "tarball": "https://registry.npmjs.org/gulp-zip/-/gulp-zip-3.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "b367427a8ead81cf732c4da7112c8b306911cdee", + "homepage": "https://github.com/sindresorhus/gulp-zip#readme", + "keywords": [ + "gulpplugin", + "zip", + "archive", + "archiver", + "compress", + "compression", + "file" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "kevva", + "email": "kevinmartensson@gmail.com" + } + ], + "name": "gulp-zip", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/gulp-zip.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "3.2.0" +} diff --git a/node_modules/gulp-zip/readme.md b/node_modules/gulp-zip/readme.md new file mode 100644 index 000000000..ad01564f9 --- /dev/null +++ b/node_modules/gulp-zip/readme.md @@ -0,0 +1,47 @@ +# gulp-zip [![Build Status](https://travis-ci.org/sindresorhus/gulp-zip.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-zip) + +> ZIP compress files + + +## Install + +``` +$ npm install --save-dev gulp-zip +``` + + +## Usage + +```js +const gulp = require('gulp'); +const zip = require('gulp-zip'); + +gulp.task('default', () => { + return gulp.src('src/*') + .pipe(zip('archive.zip')) + .pipe(gulp.dest('dist')); +}); +``` + + +## API + +Supports [streaming mode](https://github.com/gulpjs/gulp/blob/master/docs/API.md#optionsbuffer). + +### zip(filename, options) + +#### filename + +Type: `string` + +#### options + +##### compress + +Type: `boolean`<br> +Default: `true` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |