UNPKG
multi-djs
Version:
latest (0.0.16)
0.0.16
0.0.15
0.0.14
0.0.12
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.4
0.0.2
A npm of image manipulation, gif catcher and functions
multi-djs
/
src
/
photoshop
/
rotate.js
7 lines
•
285 B
JavaScript
View Raw
1
2
3
4
5
6
7
module
.
exports
=
async
(image, angle =
0
) => {
if
(!image)
throw
new
Error
(
"Parâmetro <image> não definido!"
);
const
jimp =
require
(
"jimp"
); image =
await
jimp.
read
(image); image.
rotate
(angle);
return
await
image.
getBufferAsync
(
"image/png"
); }