# filepreviews

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

Latest version **2.0.1** (published 2015-11-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install filepreviews
pnpm add filepreviews
yarn add filepreviews
bun add filepreviews
```

Provides the command `filepreviews`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2015-11-16 |
| First published | 2014-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Giovanni Collazo |
| Maintainers | gcollazo, jpadilla |

## Links

- npm: https://www.npmjs.com/package/filepreviews
- Repository: https://github.com/GetBlimp/filepreviews-node
- Homepage: https://github.com/GetBlimp/filepreviews-node#readme
- Issues: https://github.com/GetBlimp/filepreviews-node/issues
- npm.io page: https://npm.io/package/filepreviews

## Dependencies (3)

- [request](https://npm.io/package/request.md) ^2.34.0
- [commander](https://npm.io/package/commander.md) ^2.2.0
- [valid-url](https://npm.io/package/valid-url.md) ^1.0.9

## Recent versions

- 2.0.1 (latest) — 2015-11-16
- 2.0.0 — 2015-07-14
- 1.5.0 — 2014-08-25
- 1.4.1 — 2014-08-24
- 1.4.0 — 2014-06-25
- 1.3.0 — 2014-06-12
- 1.2.0 — 2014-06-06
- 1.1.0 — 2014-05-02
- 1.0.9 — 2014-04-29
- 1.0.8 — 2014-04-29
- 1.0.6 — 2014-04-27
- 1.0.5 — 2014-04-27
- 1.0.4 — 2014-04-27
- 1.0.2 — 2014-04-25
- 1.0.0 — 2014-04-25

## README

# FilePreviews.io

[![Build Status](https://travis-ci.org/GetBlimp/filepreviews-node.svg)](https://travis-ci.org/GetBlimp/filepreviews-node)

Node.js client library and CLI tool for the [FilePreviews.io](http://filepreviews.io) service. Generate image previews and metadata from almost any kind of file.

## Installation

```
npm install filepreviews
```

### Example code

```js
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.

```js
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
```

---
_Source: https://npm.io/package/filepreviews · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
