This is a client library for the Demo API of FilePreviews.io service. A lot more to come very soon.
npm install filepreviews
var FilePreviews = require('filepreviews'),
previews = new FilePreviews({debug: true});
previews.generate(url, function(err, result) {
if (err) console.error(err);
console.log(result.previewURL);
console.log(result.metadata);
});
You can optinally send an options object.
var previews = new FilePreviews({debug: true});
var options = {
size: {
width: 100,
height: 999,
},
// supported:
// 'exif', 'ocr', 'psd', 'checksum', 'multimedia',
// and 'all' which means everything
metadata: ['exif', 'ocr', 'psd'],
//supported:
// 'jpg', 'png'
format: 'jpg'
}
previews.generate(url, options, function(err, result) {
console.log(result.previewURL);
console.log(result.metadata);
});
We made a very simple CLI tool that comes bundled with this module and allows you to very easily test the FilePreviews.io API.
npm install -g filepreviews
filepreviews [options] [url]
filepreviews https://www.filepicker.io/api/file/mbsbe85FTIW6DzYlkav2