Created
October 14, 2013 23:26
-
-
Save kylemanna/6983997 to your computer and use it in GitHub Desktop.
Example use of node-tar. that create a tarball of the "public" directory and writes it to out.tar.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// npm install tar fstream | |
var tar = require('tar'); | |
var fstream = require('fstream'); | |
var path = require('path'); | |
var dst = fstream.Writer( { path: 'out.tar' } ); | |
var src = fstream.Reader({ path: path.join(__dirname, './public'), type: "Directory" }); | |
var pack = src.pipe(tar.Pack({ noProprietary: true })); | |
var out = pack.pipe(dst); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment