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

detect-file-type

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-file-type - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

package.json
{
"name": "detect-file-type",
"version": "0.0.7",
"version": "0.0.8",
"description": "Detect file type by signature",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,3 @@ # detect-file-type

### Поддерживаемые типы (будет пополнятся)
jpg, png, gif, bmp, webp, tif, cr2, jxr, psd, zip, epub, xpi, tar, rar, gz, bz2, 7z, dmg, mp4, m4v, midi, mkv, webm, wmv, mpg, mp3, m4a, opus, ogg, flac, wav, amr, pdf, exe, swf, rtf
jpg, png, gif, bmp, webp, tif, cr2, jxr, psd, zip, epub, xpi, tar, rar, gz, bz2, 7z, dmg, mp4, m4v, midi, mkv, webm, wmv, mpg, mov, avi, mp3, m4a, opus, ogg, flac, wav, amr, pdf, exe, swf, rtf

@@ -9,0 +9,0 @@ ## Usage

@@ -6,3 +6,3 @@ # detect-file-type [![Build Status](https://travis-ci.org/dimapaloskin/detect-file-type.svg?branch=master)](https://travis-ci.org/dimapaloskin/detect-file-type)

### Supported types (will be updated)
jpg, png, gif, bmp, webp, tif, cr2, jxr, psd, zip, epub, xpi, tar, rar, gz, bz2, 7z, dmg, mp4, m4v, midi, mkv, webm, wmv, mpg, mp3, m4a, opus, ogg, flac, wav, amr, pdf, exe, swf, rtf
jpg, png, gif, bmp, webp, tif, cr2, jxr, psd, zip, epub, xpi, tar, rar, gz, bz2, 7z, dmg, mp4, m4v, midi, mkv, webm, wmv, mpg, mov, avi, mp3, m4a, opus, ogg, flac, wav, amr, pdf, exe, swf, rtf

@@ -9,0 +9,0 @@ ## Installation

@@ -425,3 +425,22 @@ [

]
},
{
"type": "mov",
"ext": "mov",
"mime": "video/quicktime",
"rules": [
{ "type": "equal", "start": 0, "end": 8, "bytes": "0000001466747970" }
]
},
{
"type": "avi",
"ext": "avi",
"mime": "video/x-msvideo",
"rules": [
{ "type": "equal", "start": 0, "end": 4, "bytes": "52494646" },
{ "type": "equal", "start": 8, "end": 11, "bytes": "415649" }
]
}
]

@@ -413,2 +413,24 @@ import {assert} from 'chai';

it('should detect mov', (done) => {
detect.fromFile('./files/fixture.mov', (err, result) => {
assert.equal(err, null);
assert.deepEqual(result, {
ext: 'mov',
mime: 'video/quicktime'
});
done();
});
});
it('should detect avi', (done) => {
detect.fromFile('./files/fixture.avi', (err, result) => {
assert.equal(err, null);
assert.deepEqual(result, {
ext: 'avi',
mime: 'video/x-msvideo'
});
done();
});
});
});

@@ -419,2 +419,24 @@ 'use strict';

});
it('should detect mov', function (done) {
_index2.default.fromFile('./files/fixture.mov', function (err, result) {
_chai.assert.equal(err, null);
_chai.assert.deepEqual(result, {
ext: 'mov',
mime: 'video/quicktime'
});
done();
});
});
it('should detect avi', function (done) {
_index2.default.fromFile('./files/fixture.avi', function (err, result) {
_chai.assert.equal(err, null);
_chai.assert.deepEqual(result, {
ext: 'avi',
mime: 'video/x-msvideo'
});
done();
});
});
});
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