Check if a Buffer/Uint8Array is a postscript
$ npm install --save is-postscript
const readChunk = require('read-chunk'); // npm install read-chunk
const isPostscript = require('is-postscript');
const buf = readChunk.sync('program.ps', 0, 2);
isPostscript(buf);
//=> true
MIT © Arthur Verschaeve