Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chartiq/vinyl-tar

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chartiq/vinyl-tar

vinyl binding for tar-stream

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-78.95%
Maintainers
4
Weekly downloads
 
Created
Source

@chartiq/vinyl-tar

Create a tarball from a vinyl stream. Extract a tarball as a vinyl stream source.

install

npm install --save @chartiq/vinyl-tar

pack

Creates a tarball from a vinyl stream. Acts like a vinyl adapter's destination stream.

const {pack} = require('@chartiq/vinyl-tar');
const fs = require('fs');
const through = require('through2');
const vfs = require('vinyl-fs');

vfs.src('**/*.txt')
	.pipe(through.obj((file, enc, next) => {
		const str = file.contents.toString();

		file.contents = Buffer.from(str.toUpperCase());

		next(null, file);
	}))
	.pipe(pack())
	.pipe(fs.createWriteStream('./uppercase.tar'));

extract

Emits each entry of the tarball as a vinyl object. Acts like a vinyl adapter's source stream.

const {extract} = require('@chartiq/vinyl-tar');
const fs = require('fs');
const through = require('through2');
const vfs = require('vinyl-fs');

fs.createReadStream('./files.tar')
	.pipe(extract())
	.pipe(through.obj((file, enc, next) => {
		if (file.stat.isBuffer() && file.stat.size > 1024) {
			next(null, file);
		} else {
			next(null);
		}
	}))
	.pipe(vfs.dest('files'));

FAQs

Package last updated on 19 Apr 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc