Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@types/tar
Advanced tools
TypeScript definitions for tar
@types/tar provides TypeScript type definitions for the 'tar' npm package, which is used for creating and extracting tar archives.
Creating a tar archive
This feature allows you to create a tar archive from a list of files and directories. The example code creates a gzip-compressed tar archive named 'archive.tar.gz' containing 'file1', 'file2', and 'directory'.
const tar = require('tar');
tar.c({
gzip: true,
file: 'archive.tar.gz'
}, ['file1', 'file2', 'directory']).then(() => {
console.log('Archive created successfully');
});
Extracting a tar archive
This feature allows you to extract a tar archive to a specified directory. The example code extracts 'archive.tar.gz' into the 'output_directory'.
const tar = require('tar');
tar.x({
file: 'archive.tar.gz',
C: 'output_directory'
}).then(() => {
console.log('Archive extracted successfully');
});
Listing files in a tar archive
This feature allows you to list the files contained in a tar archive. The example code lists the files in 'archive.tar.gz'.
const tar = require('tar');
tar.t({
file: 'archive.tar.gz'
}).then((list) => {
console.log('Files in archive:', list);
});
node-tar is the core package for handling tar archives in Node.js. It provides functionalities for creating, extracting, and listing tar archives. @types/tar provides TypeScript definitions for this package.
tar-stream is a lower-level package for creating and extracting tar streams. It provides more granular control over the tar archive creation and extraction process compared to node-tar.
yauzl is a package for handling zip archives, which is a different format from tar. It provides functionalities for reading and extracting zip files, similar to what node-tar does for tar files.
npm install --save @types/tar
This package contains type definitions for tar (https://github.com/npm/node-tar).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tar.
These definitions were written by Maxime LUCE, and Connor Peet.
FAQs
TypeScript definitions for tar
The npm package @types/tar receives a total of 525,796 weekly downloads. As such, @types/tar popularity was classified as popular.
We found that @types/tar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.