From ab98ab4feecb134c1d3751eb2398b8b1880cd5c2 Mon Sep 17 00:00:00 2001 From: SomaticIT Date: Tue, 16 Sep 2014 01:55:33 +0200 Subject: [PATCH] Add node-tar test suite --- node-tar/node-tar-tests.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 node-tar/node-tar-tests.ts diff --git a/node-tar/node-tar-tests.ts b/node-tar/node-tar-tests.ts new file mode 100644 index 000000000..0a526faca --- /dev/null +++ b/node-tar/node-tar-tests.ts @@ -0,0 +1,28 @@ +/** +* Test suite created by Maxime LUCE +* +* Created by using code samples from https://github.com/npm/node-tar. +*/ + +/// +/// + +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) => { + +});