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: 2 months ago
JSON representation
Node.js client for the Tinify API.
- Host: GitHub
- URL: https://github.com/tinify/tinify-nodejs
- Owner: tinify
- License: mit
- Created: 2015-07-08T12:33:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T13:39:29.000Z (5 months ago)
- Last Synced: 2025-04-06T08:03:12.979Z (3 months ago)
- Topics: compression, image-processing, node-js, npm-package, tinyjpg, tinypng
- Language: TypeScript
- Homepage: https://tinypng.com/developers
- Size: 271 KB
- Stars: 432
- Watchers: 9
- Forks: 45
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/tinify)
# 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
```#### To test with proxy:
$ docker run --rm -it -v ~/.mitmproxy:/home/mitmproxy/.mitmproxy -p 8080:8080 mitmproxy/mitmproxy mitmproxy --listen-host 0.0.0.0
$ TINIFY_PROXY=http://172.17.0.3:8080 npm run integration
## License
This software is licensed under the MIT License. [View the license](LICENSE).