has-bytes
0.0.2 • Public • Published has-bytes
Quickly Determine if a File has Certain Byte Sequences
background
You can use this to quickly identify a file type
install
usage
const fs = require("fs");
const hasBytes = require("./has-bytes");
const buffer = fs.readFileSync("./data/flower.jpg");
const { result } = hasBytes({
data: buffer,
debug: false,
sequences: {
magic: [255, 216, 255],
EOI: [0xFF, 0xD9]
}
});
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.0.2
2
Version History
Package Sidebar
Install
Weekly Downloads