function get(url) {
  return new Promise((resolve, reject) => {
    web
      .get(url, (res) => {
        let contents = '';

        res.on('data', (chunk) => (contents += chunk));
        res.on('end', () => {
          try {
            resolve(JSON.parse(contents));
          } catch (err) {
            reject(
              new Error(`Failed to parse JSON from ${url}: ${err.message}`)
            );
          }
        });

        res.on('error', (err) => {
          reject(new Error(`Request failed for ${url}: ${err.message}`));
        });
      })
      .on('error', (err) => {
        reject(new Error(`Connection failed for ${url}: ${err.message}`));
      });
  });
}
@param {string} url
@returns Promise<any>