Galerie und tage

This commit is contained in:
2021-11-23 17:56:26 +01:00
parent ff35366279
commit 5f873bee89
4693 changed files with 149659 additions and 301447 deletions

143
node_modules/decompress/readme.md generated vendored
View File

@@ -7,97 +7,128 @@
## Install
```
$ npm install decompress
$ npm install --save decompress
```
## Usage
```js
const decompress = require('decompress');
const Decompress = require('decompress');
decompress('unicorn.zip', 'dist').then(files => {
console.log('done!');
});
new Decompress({mode: '755'})
.src('foo.zip')
.dest('dest')
.use(Decompress.zip({strip: 1}))
.run();
```
## API
### decompress(input, [output], [options])
### new Decompress(options)
Returns a Promise for an array of files in the following format:
Creates a new `Decompress` instance.
```js
{
data: Buffer,
mode: Number,
mtime: String,
path: String,
type: String
}
```
#### input
Type: `string` `Buffer`
File to decompress.
#### output
#### options.mode
Type: `string`
Output directory.
Set mode on the extracted files, i.e `{ mode: '755' }`.
#### options
#### options.strip
##### filter
Type: `number`
Type: `Function`
Equivalent to `--strip-components` for tar.
Filter out files before extracting. E.g:
### .src(files)
#### files
Type: `array`, `buffer` or `string`
Set the files to be extracted.
### .dest(path)
#### path
Type: `string`
Set the destination to where your file will be extracted to.
### .use(plugin)
#### plugin
Type: `function`
Add a `plugin` to the middleware stack.
### .run(callback)
Extract your file with the given settings.
#### callback(err, files)
Type: `function`
The callback will return an array of vinyl files in `files`.
## Plugins
The following [plugins](https://www.npmjs.org/browse/keyword/decompressplugin) are bundled with decompress:
* [tar](#tar) — Extract TAR files.
* [tar.bz2](#tarbz2) — Extract TAR.BZ files.
* [tar.gz](#targz) — Extract TAR.GZ files.
* [zip](#zip) — Extract ZIP files.
### .tar(options)
Extract TAR files.
```js
decompress('unicorn.zip', 'dist', {
filter: file => path.extname(file.path) !== '.exe'
}).then(files => {
console.log('done!');
});
const Decompress = require('decompress');
new Decompress()
.use(Decompress.tar({strip: 1}));
```
*Note that in the current implementation, **`filter` is only applied after fully reading all files from the archive in memory**. Do not rely on this option to limit the amount of memory used by `decompress` to the size of the files included by `filter`. `decompress` will read the entire compressed file into memory regardless.*
### .tarbz2(options)
##### map
Type: `Function`
Map files before extracting: E.g:
Extract TAR.BZ files.
```js
decompress('unicorn.zip', 'dist', {
map: file => {
file.path = `unicorn-${file.path}`;
return file;
}
}).then(files => {
console.log('done!');
});
const Decompress = require('decompress');
new Decompress()
.use(Decompress.tarbz2({strip: 1}));
```
##### plugins
### .targz(options)
Type: `Array`<br>
Default: `[decompressTar(), decompressTarbz2(), decompressTargz(), decompressUnzip()]`
Extract TAR.GZ files.
Array of [plugins](https://www.npmjs.com/browse/keyword/decompressplugin) to use.
```js
const Decompress = require('decompress');
##### strip
new Decompress()
.use(Decompress.targz({strip: 1}));
```
Type: `number`<br>
Default: `0`
### .zip(options)
Remove leading directory components from extracted files.
Extract ZIP files.
```js
const Decompress = require('decompress');
new Decompress()
.use(Decompress.zip({strip: 1}));
```
## License