async function fromEPSGCode(code) {
  if (typeof code === 'string') {
    code = parseInt(code.split(':').pop(), 10);
  }

  const proj4 = registered;
  if (!proj4) {
    throw new Error('Proj4 must be registered first with register(proj4)');
  }

  const epsgCode = 'EPSG:' + code;
  if (proj4.defs(epsgCode)) {
    return getCachedProjection(epsgCode);
  }

  proj4.defs(epsgCode, await epsgLookup(code));
  register(proj4);

  return getCachedProjection(epsgCode);
}
Get a projection from an EPSG code.  This function fetches the projection
definition from the epsg.io website, registers this definition for use with
proj4, and returns a configured projection.  You must call import proj4 and
call {@link module:ol/proj/proj4.register} before using this function.

If the projection definition is already registered with proj4, it will not
be fetched again (so it is ok to call this function multiple times with the
same code).

@param {number|string} code The EPSG code (e.g. 4326 or 'EPSG:4326').
@return {Promise<Projection>} The projection.
@api