All Projects → filepreviews → filepreviews-node

filepreviews / filepreviews-node

Licence: MIT license
Node.js client library for the FilePreviews.io service.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to filepreviews-node

filepreviews.js
Deprecated: JavaScript client library for the FilePreviews.io service
Stars: ✭ 54 (+184.21%)
Mutual labels:  filepreviews
wagtail-filepreviews
Extend Wagtail's Documents with image previews and metadata from FilePreviews
Stars: ✭ 21 (+10.53%)
Mutual labels:  filepreviews

FilePreviews.io

Build Status

Node.js client library and CLI tool for the FilePreviews.io service. Generate image previews and metadata from almost any kind of file.

Installation

npm install filepreviews

Example code

var FilePreviews = require('filepreviews');

var previews = new FilePreviews({
  debug: true,
  apiKey: 'API_KEY_HERE',
  apiSecret: 'API_SECRET_HERE'
});

previews.generate(url, function(err, result) {
  console.log(err);
  console.log(result.id);
  console.log(result.status);

  previews.retrieve(result.id, function(err, result) {
    console.log(result);
  });
});

Options

You can optionally send an options object.

var FilePreviews = require('filepreviews');

var previews = new FilePreviews({
  debug: true,
  apiKey: 'API_KEY_HERE',
  apiSecret: 'API_SECRET_HERE'
});

var options = {
  size: {
    width: 250,
    height: 250,
  },
  metadata: ['exif', 'ocr', 'psd'],
  format: 'jpg',
  data: { foo: 'bar' }
}

previews.generate(url, options, function(err, result) {
  console.log(result.id);
  console.log(result.status);
});

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].