file-detect
Advanced tools
Comparing version 0.1.0 to 0.1.1
14
lib.js
@@ -15,9 +15,9 @@ // Generated by CoffeeScript 1.7.1 | ||
MAGIC_DATA = { | ||
"png": "89 50 4e 47", | ||
"jpg": "ff d8 ff e0", | ||
"gif": "47 49 46 38", | ||
"bmp": "42 4d", | ||
"bz": "42 5a", | ||
"gz": "1f 8b", | ||
"zip": "50 4b 03 04" | ||
"png": "89504e47", | ||
"jpg": "ffd8ffe0", | ||
"gif": "47494638", | ||
"bmp": "424d", | ||
"bz": "425a", | ||
"gz": "1f8b", | ||
"zip": "504b0304" | ||
}; | ||
@@ -24,0 +24,0 @@ |
{ | ||
"name": "file-detect", | ||
"version": "0.1.0" | ||
"version": "0.1.1" | ||
} |
@@ -1,15 +0,26 @@ | ||
##node-file-detect | ||
## node-file-detect | ||
detect file | ||
Detect file type. | ||
###useage | ||
### Usage | ||
var file-detect = require("file-detect"); | ||
file-detect.is("/example/sample.png", ".png", function(err, isPNG){ | ||
var fd = require("file-detect"); | ||
fd.is("/example/sample.png", ".png", function(err, isPNG){ | ||
// some more code with the result | ||
}); | ||
###Reference | ||
### Supported file type | ||
+ .png | ||
+ .jpg | ||
+ .gif | ||
+ .bmp | ||
+ .bz | ||
+ .gz | ||
+ .zip | ||
### Reference | ||
1. <http://en.wikipedia.org/wiki/List_of_file_signatures> | ||
2. <http://stackoverflow.com/a/8475542/1778658> | ||
3. <http://www.astro.keele.ac.uk/oldusers/rno/Computing/File_magic.html> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4656
27