This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import { fileURLToPath } from 'url'; | |
// get the path of the current file | |
const __filename = fileURLToPath(import.meta.url); | |
// get the current directory | |
const __dirname = path.dirname(__filename); | |
const absolutePath = __dirname + "/" + "somePicture.jpg"; | |
console.log(absolutePath) |