mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 16:45:10 +08:00
* archiver clean up and updated version * added tslint.json * added back in create because it still works. Updated examples * fixed listing issues * fixed more linting issues * added glob options and EntryData * added more to tests * fixed tests by returning this, instead of void * removed whitespace * Add node types import * Keep original author
42 lines
966 B
TypeScript
42 lines
966 B
TypeScript
import * as Archiver from 'archiver';
|
|
import * as fs from 'fs';
|
|
|
|
const archiver = Archiver.create('zip');
|
|
|
|
const writeStream = fs.createWriteStream('./archiver.d.ts');
|
|
const readStream = fs.createReadStream('./archiver.d.ts');
|
|
|
|
archiver.abort();
|
|
|
|
archiver.pipe(writeStream);
|
|
archiver.append(readStream, { name: 'archiver.d.ts' });
|
|
|
|
archiver.append(readStream, {name: 'archiver.d.ts'})
|
|
.append(readStream, {name: 'archiver.d.ts'});
|
|
|
|
archiver.bulk({ mappaing: {} });
|
|
|
|
archiver.directory('./path', './someOtherPath');
|
|
archiver.directory('./path', { name: "testName" });
|
|
archiver.directory('./', "", {});
|
|
archiver.directory('./', { name: 'test' }, {});
|
|
|
|
archiver.append(readStream, {
|
|
name: "sub/folder.xml"
|
|
});
|
|
|
|
archiver.glob("**", {
|
|
cwd: 'path/to/files',
|
|
});
|
|
archiver.glob('./path', {}, {});
|
|
|
|
archiver.file('./path', { name: 'test' });
|
|
|
|
archiver.setFormat('zip');
|
|
archiver.setModule(() => {});
|
|
|
|
archiver.pointer();
|
|
archiver.use(() => {});
|
|
|
|
archiver.finalize();
|