git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6e9c872
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
node_modules
tar
examples
packer.js
[add] server:lib:node_modules
Christian Fraß
commited
6e9c872
at 2021-03-08 23:52:07
packer.js
Blame
History
Raw
var tar = require("../tar.js") , fstream = require("fstream") , fs = require("fs") var dirDest = fs.createWriteStream('dir.tar') function onError(err) { console.error('An error occurred:', err) } function onEnd() { console.log('Packed!') } var packer = tar.Pack({ noProprietary: true }) .on('error', onError) .on('end', onEnd); // This must be a "directory" fstream.Reader({ path: __dirname, type: "Directory" }) .on('error', onError) .pipe(packer) .pipe(dirDest)