i18nexus-cli
Version:
Command line interface (CLI) for accessing the i18nexus API
19 lines (14 loc) • 421 B
JavaScript
const fetch = require('node-fetch');
const HttpsProxyAgent = require('https-proxy-agent');
const handleFetch = (url, fetchOptions = {}) => {
const proxy =
process.env.http_proxy ||
process.env.HTTP_PROXY ||
process.env.https_proxy ||
process.env.HTTPS_PROXY;
if (proxy) {
fetchOptions.agent = new HttpsProxyAgent(proxy);
}
return fetch(url, fetchOptions);
};
module.exports = handleFetch;