Socket
Socket
Sign inDemoInstall

archive-type

Package Overview
Dependencies
53
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 2.0.0

0

cli.js

@@ -0,0 +0,0 @@ #!/usr/bin/env node

40

index.js
'use strict';
var fileType = require('file-type');
/**

@@ -11,31 +13,13 @@ * Detect the archive type of a Buffer/Uint8Array

module.exports = function (buf) {
if (!buf) {
return false;
}
var ret = fileType(buf);
var exts = [
'7z',
'bz2',
'gz',
'rar',
'tar',
'zip'
];
if (require('is-7zip')(buf)) {
return '7z';
}
if (require('is-bzip2')(buf)) {
return 'bz2';
}
if (require('is-gzip')(buf)) {
return 'gz';
}
if (require('is-rar')(buf)) {
return 'rar';
}
if (require('is-tar')(buf)) {
return 'tar';
}
if (require('is-zip')(buf)) {
return 'zip';
}
return false;
return exts.indexOf(ret && ret.ext) !== -1 ? ret : null;
};
{
"name": "archive-type",
"version": "1.0.4",
"version": "2.0.0",
"description": "Detect the archive type of a Buffer/Uint8Array",

@@ -41,9 +41,4 @@ "license": "MIT",

"dependencies": {
"file-type": "^2.0.1",
"get-stdin": "^3.0.0",
"is-7zip": "^1.0.0",
"is-bzip2": "^1.0.0",
"is-gzip": "^1.0.0",
"is-rar": "^1.0.0",
"is-tar": "^1.0.0",
"is-zip": "^1.0.0",
"meow": "^2.0.0",

@@ -53,4 +48,4 @@ "read-chunk": "^1.0.0"

"devDependencies": {
"ava": "0.0.4"
"ava": "^0.0.4"
}
}

@@ -19,3 +19,3 @@ # archive-type [![Build Status](https://travis-ci.org/kevva/archive-type.svg?branch=master)](https://travis-ci.org/kevva/archive-type)

archiveType(read('foo.zip'));
// => zip
//=> { ext: 'zip', mime: 'application/zip' }
```

@@ -22,0 +22,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc