This is the official library for the moify.me service. It is used internally by the web interface.
Moify is a rate-limited service, this library is low-level and will return a fail if you hit the limit, leaving you to handle this and/or retry later. In this case, please follow an exponential backoff.
npm install --save moify
let moify = require('moify')
moify.url('')
.then(moifiedUrl => void console.log(moifiedUrl))
.catch(console.error)
moify.file('/path/to/file.png') // or jpeg, or gif, or webm...
.then(moifiedBlob => {})
require('fs').createReadStream('file.gif').pipe(moify.blob())
moify.blob(require('fs').readFileSync('file.jpg')) // Buffers are fine
moify.cache('17264a72f73bc9233d83474e274f274237')
.then(moifiedUrl => {})Promises are native ES6, and may be consumed by any Promise-aware library.
In browser environments, Blobs are used where Buffers are specified below,
and the Stream variants are not available. In browsers where native Promises
are not available, they are shimmed using jakearchibald's ES6 Promise polyfill.
//
//
//
//
//
//
//
//
//
//
//
//
//
Licensed under MIT.