is-pdf

Check if a Buffer/Uint8Array is a 7ZIP file

is-pdf

Check if a Buffer/Uint8Array is a PDF file

$ npm install --save is-pdf
var isPdf = require('is-pdf');
var read = require('fs').readFileSync;
 
isPdf(read('foo.pdf'));
// => true 

MIT License © Kevin Mårtensson