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 2.0.0 to 2.1.0

license

27

cli.js
#!/usr/bin/env node
'use strict';
var archiveType = require('./');
var meow = require('meow');
var getStdin = require('get-stdin');
var readChunk = require('read-chunk');
var stdin = require('get-stdin');
var archiveType = require('./');
/**
* Initialize CLI
*/
var cli = meow({

@@ -25,6 +21,2 @@ help: [

/**
* Run
*/
function run(data) {

@@ -41,6 +33,2 @@ var type = archiveType(new Buffer(data));

/**
* Get stdin
*/
if (process.stdin.isTTY) {

@@ -59,12 +47,5 @@ if (!cli.input.length) {

readChunk(cli.input[0], 0, 262, function (err, buf) {
if (err) {
console.error(err.message);
process.exit(1);
}
run(buf);
});
run(readChunk.sync(cli.input[0], 0, 262));
} else {
stdin.buffer(run);
getStdin.buffer(run);
}

@@ -5,9 +5,2 @@ 'use strict';

/**
* Detect the archive type of a Buffer/Uint8Array
*
* @param {Buffer} buf
* @api public
*/
module.exports = function (buf) {

@@ -14,0 +7,0 @@ var ret = fileType(buf);

{
"name": "archive-type",
"version": "2.0.0",
"version": "2.1.0",
"description": "Detect the archive type of a Buffer/Uint8Array",

@@ -42,4 +42,4 @@ "license": "MIT",

"file-type": "^2.0.1",
"get-stdin": "^3.0.0",
"meow": "^2.0.0",
"get-stdin": "^4.0.1",
"meow": "^3.1.0",
"read-chunk": "^1.0.0"

@@ -46,0 +46,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