Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/filepreviews/filepreviews.js

Deprecated: JavaScript client library for the FilePreviews.io service
https://github.com/filepreviews/filepreviews.js

filepreviews javascript

Last synced: 4 months ago
JSON representation

Deprecated: JavaScript client library for the FilePreviews.io service

Awesome Lists containing this project

README

        

**⚠️ Deprecated ⚠️**

# FilePreviews.io
[![Build Status](https://travis-ci.org/GetBlimp/filepreviews.js.svg)](https://travis-ci.org/GetBlimp/filepreviews.js)

JavaScript client library for the [FilePreviews.io](http://filepreviews.io) service.

## How to use
#### Install using bower
```
bower install filepreviews
```

#### Use from our CDN distribution
```html

```

#### Download
You can also download the latest version from the [releases page](https://github.com/GetBlimp/filepreviews.js/releases/).

## Example code
```js
var previews = new FilePreviews({
debug: true,
apiKey: 'API_KEY_HERE'
});

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

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

### Options
You can optinally send an options object.
```js
var previews = new FilePreviews({
debug: true,
apiKey: 'CLIENT_API_KEY_HERE'
});

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

previews.generate(url, options, function(err, result) {
console.log(result.previewURL);
console.log(result.metadata);
});
```

## Build
```
$ git clone https://github.com/GetBlimp/filepreviews.js.git
$ cd filepreviews.js
$ npm run build
```

## Publish
```
$ npm run publish
```