mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-01 11:50:54 +08:00
Add node-tar test suite
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 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" />
|
||||
/// <referenche path="node-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) => {
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user