Skip to content

Client library for FilePreviews.io - Generate image previews and metadata from almost any kind of file

License

Notifications You must be signed in to change notification settings

emmerge/filepreviews-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FilePreviews.io

This is a client library for the Demo API of FilePreviews.io service. A lot more to come very soon.

Sign up to beta

Installation

npm install filepreviews

Example code

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);
});

Options

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);
});

CLI

We made a very simple CLI tool that comes bundled with this module and allows you to very easily test the FilePreviews.io API.

Install globally

npm install -g filepreviews

CLI Usage

filepreviews [options] [url]

Example

filepreviews https://www.filepicker.io/api/file/mbsbe85FTIW6DzYlkav2

About

Client library for FilePreviews.io - Generate image previews and metadata from almost any kind of file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%