https://github.com/lsongdev/tinypng
:panda_face: Tinypng API in Node.js
https://github.com/lsongdev/tinypng
compressor png-compression tinypng
Last synced: 8 months ago
JSON representation
:panda_face: Tinypng API in Node.js
- Host: GitHub
- URL: https://github.com/lsongdev/tinypng
- Owner: lsongdev
- License: mit
- Created: 2019-07-30T09:15:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-21T05:49:55.000Z (about 6 years ago)
- Last Synced: 2025-02-13T22:23:50.052Z (8 months ago)
- Topics: compressor, png-compression, tinypng
- Language: JavaScript
- Homepage: https://tinypng.com
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## tinypng [](https://npmjs.org/tinypng2)
> 🐼 Tinypng API in Node.js
### Installation
```bash
$ npm install tinypng2
```### Example
```js
const tinypng = require('tinypng2')({
key: '-- YOUR LICENSE KEY HERE --'
});(async () => {
const output = await tinypng('/tmp/input.png');
console.log(output.url);
await output.save('/tmp/output.png');
// resize - fit
const fit = await output.fit(150, 100);
await fit.save('/tmp/output-fit.png');
})();
```### CLI Usage
```bash
~$ tinypng input.png output.png
```### Contributing
- Fork this Repo first
- Clone your Repo
- Install dependencies by `$ npm install`
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3### MIT
This work is licensed under the [MIT license](./LICENSE).
---