fetch('https://example.com/path',
{method:'GET',
headers: {
'Authorization': 'Basic ' + btoa('login:password') //use btoa in js and Base64.encode in node
}
})
.then(response => response.json())
.then(json => console.log(json));