1.0.7 • Published 1 year ago

isignature v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

iSignature

File extractor to get real extension of file given by checking through the file's signature

Installation

Using NPM:

npm install isignature

Using Yarn:

yarn add isignature

Usage

const { getSignature } = require("isignature")
const somefile = require("./path/to/somefile.jpg")

const data = getSignature(somefile)
console.log(data)

Response

PropertyDescriptionExample
valueThe exact match extensionjpg
possibilityThe nearest match to your file['jpg', 'jpeg']
matchThe boolean answer if the given file is matchtrue
filehexThe short hex value of your file00 12 34 56 78

References

signature.json