I've been trying to make a code to generate an image on node.js using Canvas , but I'm facing the problem that the image is not loaded before using it. I tried using "onload" but that did not work (I never ran the code)
Here is the "base" of my code
const Canvas = require('canvas-prebuilt'), Image = Canvas.Image;
var canvas = new Canvas(300, 300);
var ctx = canvas.getContext('2d');
var img1 = new Image();
ctx.drawImage(img1, 100, 90, canvas.height / 6, canvas.height / 6);