node/deps/npm/node_modules/tar/examples/packer.js

10 lines
295 B
JavaScript
Raw Normal View History

2014-08-01 00:05:30 +08:00
var tar = require("../tar.js")
, fstream = require("fstream")
, fs = require("fs")
var dir_destination = fs.createWriteStream('dir.tar')
// This must be a "directory"
fstream.Reader({ path: __dirname, type: "Directory" })
.pipe(tar.Pack({ noProprietary: true }))
.pipe(dir_destination)