External API fetch

Is it possible to make external API requests from a plugin? I tried with "fetch" but I got a bunch of errors like:

    ERROR in ./node_modules/node-fetch/src/index.js
    Module not found: Error: Can't resolve 'node:http' in 'C:\Testing\node_modules\node-fetch\src'
     @ ./node_modules/node-fetch/src/index.js 9:0-29 52:58-62
     @ ./src/index.ts
    ERROR in chunk main [entry]
    index.js
    C:\Testing\node_modules\node-fetch\src\index.js 418bdaf516376824f6a7c1cc01d98479
    Unexpected token (271:11)
    |   if ((body instanceof !(function webpackMissingModule() { var e = new Error("Cannot find module 'node:stream'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())) && (typeof body.getBoundary !== 'function')) {
    |           // Tee instance body
    |           p1 = new !(function webpackMissingModule() { var e = new Error("Cannot find module 'node:stream'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({highWaterMark});
    |           p2 = new !(function webpackMissingModule() { var e = new Error("Cannot find module 'node:stream'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())({highWaterMark});
    |           body.pipe(p1);

The code is:

import joplin from 'api';
import fetch from 'node-fetch';

joplin.plugins.register({
        onStart: async function() {
                const response = await fetch('https://api.github.com/users/github');
                const data = await response.json();

                console.log(data);
        },
});

Thank you.

I was playing around with something similar (which I've not got to work yet but thats because I've got no idea how to use javascript) where I was simply able to import axios from npm and use that. It gets the data I just can't do the next bit...

From a plugin you can also use joplin.data: joplin.data | Joplin Plugin API Documentation

How can I use the Joplin.data with a external URL? e.g. https://api.github.com/users/github

Thanks.