How to use the simple-get function in simple-get

To help you get started, we’ve selected a few simple-get examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / cli / src / scripts / package-yarn.js View on Github external
function download() {
  console.log('[package-yarn] Downloading bundle')
  simpleGet(bundleUrl, (err, res) => {
    if (err) {
      throw err
    }

    res.pipe(fse.createWriteStream(destination, writeFlags).on('close', writeHeader))
  })
}
github commaai / cabana / src / api / rlog.js View on Github external
return new Promise(async (resolve, reject) => {
    request(logUrl, (err, res) => {
      if (err) {
        return reject(err);
      }
      resolve(res);
    });
  });
}
github sanity-io / sanity / packages / @sanity / core / src / commands / dataset / importDatasetCommand.js View on Github external
return new Promise((resolve, reject) => {
    simpleGet(url, (err, res) => (err ? reject(err) : resolve(res)))
  })
}

simple-get

Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines.

MIT
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis