scripts/update-binaries.js
function getVersion () {
  const url = 'https://raw.githubusercontent.com/mapbox/node-sqlite3/master/package.json'
  return new Promise((resolve, reject) => {
    https.get(url, res => {
      let data = ''
      res.setEncoding('utf8')
      if (res.statusCode !== 200) return reject(res.statusMessage)
      res.on('data', chunk => { data += chunk })
      res.on('end', () => resolve(JSON.parse(data).version))
    })
  })
}
function getVersion () {
  const url = 'https://raw.githubusercontent.com/mapbox/node-sqlite3/master/package.json'
  return new Promise((resolve, reject) => {
    https.get(url, res => {
      let data = ''
      res.setEncoding('utf8')
      if (res.statusCode !== 200) return reject(res.statusMessage)
      res.on('data', chunk => { data += chunk })
      res.on('end', () => resolve(JSON.parse(data).version))
    })
  })
}
function getVersion ( ) { const url = 'https://raw.githubusercontent.com/mapbox/node-sqlite3/master/package.json' return new Promise ( ( resolve , reject ) => { https . get ( url , res => { let data = '' res . setEncoding ( 'utf8' ) if ( res . statusCode !== 200 ) return reject ( res . statusMessage ) res . on ( 'data' , chunk => { data += chunk } ) res . on ( 'end' , ( ) => resolve ( JSON . parse ( data ) . version ) ) } ) } ) }
getVersion directly from GitHub repo package.json

@returns {Promise<string>} version
@example
const version = await getVersion()
//= '3.1.8'
getVersion directly from GitHub repo package . json