finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
371 bytes
|
| Line | |
|---|
| 1 | const tar = require('tar-stream')
|
|---|
| 2 | const fs = require('fs')
|
|---|
| 3 | const path = require('path')
|
|---|
| 4 | const pipeline = require('pump') // eequire('stream').pipeline
|
|---|
| 5 |
|
|---|
| 6 | fs.createReadStream('test.tar')
|
|---|
| 7 | .pipe(tar.extract())
|
|---|
| 8 | .on('entry', function (header, stream, done) {
|
|---|
| 9 | console.log(header.name)
|
|---|
| 10 | pipeline(stream, fs.createWriteStream(path.join('/tmp', header.name)), done)
|
|---|
| 11 | })
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.