detect-file-type
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"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(); | ||
}); | ||
}); | ||
}); |
22
test.js
@@ -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(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16185541
1637