code: function writeLocationFile(location) {
    console.log('Writing location.js file')
    if (getTargetPlatform() === 'win32') {
      location = location.replace(/\\/g, '\\\\')
    }
  
    var platform = getTargetPlatform()
    var arch = getTargetArch()
  
    var contents = 'module.exports.location = "' + location + '"\n'
  
    if (/^[a-zA-Z0-9]*$/.test(platform) && /^[a-zA-Z0-9]*$/.test(arch)) {
      contents +=
          'module.exports.platform = "' + getTargetPlatform() + '"\n' +
          'module.exports.arch = "' + getTargetArch() + '"\n'
    }
  
    fs.writeFileSync(path.join(libPath, 'location.js'), contents)
  }
docs: Writes the location file with location and platform/arch metadata about the
  binary.