There is a lot resources about how to secure REST API access, but this not what I am looking for. I am going to use provided REST API with Basic Authentication (and this cannot be changed easily :( ).
Obviously I can go with:
var requestOptions = {
hostname: rest.api.url.com,
path: /path/,
auth: username:password
};
var req = http.request(requestOptions, function (res) {
// some code here
});
Is there a way to not provide password in plain text in the script?