pdfinfojs provides access to pdfinfo via shell in nodejs.
via npm:
$ npm install pdfinfojs
const pdfinfo = require('pdfinfojs');
const pdf = new pdfinfo('test/pdfs/sample.pdf');
pdf.getInfo()
.then(function (info) { // return Promise
console.log(info);
})
.catch(function (err) {
console.err(err);
});
$ npm test