Whilst the answers herein worked somewhat, I found use of the popular app-root-path module a better anchor point from which to specify a path.
import { path as arp } from 'app-root-path'
import path from 'path'
const root = path.resolve(arp, '../') // the parent of the root path
export const rootDirname = root
Example usage as follows:
import { rootDirname } from './functions/src/utils/root-dirname'
import { getJsonFromFile } from './app/utils/get-json-from-file'
const firebaseJson = getJsonFromFile(`${rootDirname}/firebase.json`)
Maybe not the best answer here but an option not covered by other answers.