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

decompress-tarbz2

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decompress-tarbz2 - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

16

index.js
'use strict';
const decompressTar = require('decompress-tar');
const fileType = require('file-type');
const isStream = require('is-stream');
const seekBzip = require('seek-bzip');
const unbzip2Stream = require('unbzip2-stream');
module.exports = () => buf => {
if (!Buffer.isBuffer(buf)) {
return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof buf}`));
module.exports = () => input => {
if (!Buffer.isBuffer(input) && !isStream(input)) {
return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`));
}
if (!fileType(buf) || fileType(buf).ext !== 'bz2') {
if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'bz2')) {
return Promise.resolve([]);
}
return decompressTar()(seekBzip.decode(buf));
if (Buffer.isBuffer(input)) {
return decompressTar()(seekBzip.decode(input));
}
return decompressTar()(input.pipe(unbzip2Stream()));
};
{
"name": "decompress-tarbz2",
"version": "4.0.0",
"version": "4.1.0",
"description": "decompress tar.bz2 plugin",

@@ -31,6 +31,8 @@ "license": "MIT",

"dependencies": {
"decompress-tar": "^4.0.0",
"decompress-tar": "^4.1.0",
"file-type": "^3.8.0",
"is-stream": "^1.1.0",
"pify": "^2.3.0",
"seek-bzip": "^1.0.5"
"seek-bzip": "^1.0.5",
"unbzip2-stream": "^1.0.9"
},

@@ -37,0 +39,0 @@ "devDependencies": {

@@ -33,5 +33,7 @@ # decompress-tarbz2 [![Build Status](https://travis-ci.org/kevva/decompress-tarbz2.svg?branch=master)](https://travis-ci.org/kevva/decompress-tarbz2)

Returns both a Promise for a Buffer and a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex).
#### buf
Type: `Buffer`
Type: `Buffer` `Stream`

@@ -38,0 +40,0 @@ Buffer to decompress.

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