license see https export async function geolocation ( ) { return new Promise ( ( resolve , reject ) => { navigator . geolocation . getCurrentPosition ( ( e ) => resolve ( e . coords ) , reject ) ; } ) ; }