Skip to content

radateklt/tgz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TGZ Archive

Lightweight .tar.gz archive

Usage example:

// Create archive
const archive = new TgzArchive('archive.tar.gz')
// Add files
await archive.add('path/to/dir', 'tar/dir')
await archive.add('path/to/file.txt', '.')
await archive.addContent('my/file.txt', 'File content')
// Finalize
await archive.finish()

// Extract to directory
await TgzArchive.extract('archive.tar.gz', './extracted')
  
// Extract file as buffer
const packageInfo = JSON.parse((await TgzArchive.extractFile('archive.tar.gz', 'package.json')).toString)

// Extract file as stream
const stream = TgzArchive.extractStream('archive.tar.gz', 'large-file.bin')
stream.pipe(fs.createWriteStream('extracted-large-file.bin'))

// Files list
const list = await TgzArchive.list('example.tar.gz')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published