🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

tar-fs

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
t

tar-fs

filesystem bindings for tar-stream

3.0.9
latest
100

Supply Chain Security

100

Vulnerability

100

Quality

91

Maintenance

100

License

Version published
Weekly downloads
22M
-4.84%
Maintainers
2
Weekly downloads
 
Created
Issues
3

What is tar-fs?

The tar-fs npm package is a Node.js module that allows you to interact with tarball (.tar) files. It provides functionality to pack and extract tarball files using file system streams. It is a high-level module that makes it easy to create and extract tar files in a Node.js environment.

What are tar-fs's main functionalities?

Packing files into a tarball

This feature allows you to pack a directory into a tarball. The code sample demonstrates how to pack the contents of '/source/directory' into a tarball named 'archive.tar' located at '/destination/'.

const tar = require('tar-fs');
const fs = require('fs');

let pack = tar.pack('/source/directory')
  .pipe(fs.createWriteStream('/destination/archive.tar'));

Extracting files from a tarball

This feature allows you to extract the contents of a tarball into a directory. The code sample demonstrates how to extract the contents of 'archive.tar' from '/source/' into the '/destination/directory'.

const tar = require('tar-fs');
const fs = require('fs');

fs.createReadStream('/source/archive.tar')
  .pipe(tar.extract('/destination/directory'));

Other packages similar to tar-fs

FAQs

Package last updated on 22 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts