mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Adding in some JSDoc for the main methods, lifted directly from documentation, and adding a TODO for the future if someone decides to type the fstream library.
32 lines
683 B
TypeScript
32 lines
683 B
TypeScript
/**
|
|
* Test suite created by Maxime LUCE <https://github.com/SomaticIT>
|
|
*
|
|
* Created by using code samples from https://github.com/npm/node-tar.
|
|
*/
|
|
|
|
/// <reference path="../node/node.d.ts" />
|
|
/// <reference path="tar.d.ts" />
|
|
|
|
import tar = require("tar");
|
|
import fs = require("fs");
|
|
|
|
/**
|
|
* Quick Extract
|
|
*/
|
|
fs.createReadStream("path/to/file.tar").pipe(tar.Extract("path/to/extract"));
|
|
|
|
/**
|
|
* Use with events
|
|
*/
|
|
var readStream = fs.createReadStream("/path/to/file.tar");
|
|
var extract = tar.Extract("/path/to/target");
|
|
|
|
readStream.pipe(extract);
|
|
|
|
extract.on("entry", (entry: any) => {
|
|
|
|
});
|
|
|
|
var packStream: tar.PackStream = tar.Pack();
|
|
packStream = tar.Pack({ path: 'test' });
|