var FourColorASCIICanvas = require('four-color-ascii-canvas');
var canvas = new FourColorASCIICanvas(WIDTH, HEIGHT);
canvas.paint(ndarray); // Flat array of RGBA pixels of length WIDTH*HEIGHT*4
See the following project: https://github.com/MX-Futhark/terminal-gbc-emulator#example