0.0.1 • Published 5 years ago

is-pdf-valid v0.0.1

Weekly downloads
915
License
MIT
Repository
github
Last release
5 years ago

isPDF

Check if is a PDF file valid.

Why

I have a file with the extension "PDF" but the file is damaged because the download was interrupted, so I need to know if it is a real PDF file.

Install

npm install is-pdf-valid --save

Example

const fs = require("fs");
const isPDF = require("is-pdf-valid");

const file = fs.readFileSync("./test.pdf")
console.log(isPDF(file));