sindresorhus/terminal-image

How to use image buffer in axios ?

naveenvignesh5 opened this issue · 1 comments

const terminalImage = require('terminal-image');
const axios = require('axios');

const run = async () => {
    let image = null;
    try {
        image = await axios.get('https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png');
        console.log(image.data);
    } catch (err) {
        console.log(err.message);
    }
    
    if (image.data) {
        console.log(await terminalImage.buffer(image.data));
    }
}

run();

I would like to know what I am doing wrong.

This is not a support channel. There's already a working example in the readme: https://github.com/sindresorhus/terminal-image#display-a-remote-image