Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tinify/tinify-nodejs

Node.js client for the Tinify API.
https://github.com/tinify/tinify-nodejs

compression image-processing node-js npm-package tinyjpg tinypng

Last synced: 3 days ago
JSON representation

Node.js client for the Tinify API.

Awesome Lists containing this project

README

        

[Build Status](https://travis-ci.org/tinify/tinify-nodejs)

# Tinify API client for Node.js

Node.js client for the Tinify API, used for [TinyPNG](https://tinypng.com) and [TinyJPG](https://tinyjpg.com). Tinify compresses your images intelligently. Read more at [http://tinify.com](http://tinify.com).

## Documentation

[Go to the documentation for the Node.js client](https://tinypng.com/developers/reference/nodejs).

## Installation

Install the API client:

```
npm install tinify
```

Or add this to your `package.json`:

```json
{
"dependencies": {
"tinify": "*"
}
}
```

## Usage

```javascript
const tinify = require("tinify");
tinify.key = "YOUR_API_KEY";

tinify.fromFile("unoptimized.png").toFile("optimized.png");
```

## Running tests

```
npm install
npm test
```

### Integration tests

```
npm install
TINIFY_KEY=$YOUR_API_KEY npm run integration
```

## License

This software is licensed under the MIT License. [View the license](LICENSE).