Skip to content

Instantly share code, notes, and snippets.

View AndikaR's full-sized avatar

Andika Ruspandi AndikaR

  • Bali, Indonesia
View GitHub Profile
@AndikaR
AndikaR / gist:bf360e726630e83e4adc68cfd369c7be
Created May 21, 2018 02:03
Example of Node Graphic Magic
var fse = require('fs-extra');
let gm = require('gm');
var readStream = fse.createReadStream('./public/test.png');
gm(readStream, 'test.png')
.borderColor('#000')
.trim()
.crop(50, 50, 0, 0)
.write('./public/test-1.png', function (err) {
if (!err) console.log('done');