@sitespeed.io/server
Version:
The sitespeed.io server
10 lines (8 loc) • 335 B
JavaScript
import path from 'node:path';
import { fileURLToPath } from 'node:url';
export function getBaseFilePath(theFile) {
const currentFileUrl = import.meta.url;
const currentFilePath = fileURLToPath(currentFileUrl);
const currentDirectory = path.dirname(currentFilePath);
return path.resolve(currentDirectory, '../../', theFile);
}