Created
April 8, 2021 13:59
-
-
Save Leo5878/bbdb2dd278ff8bb2c940ce9deaa6aab8 to your computer and use it in GitHub Desktop.
file "dirname". More details https://ru.hexlet.io/blog/posts/chto-takoe-__dirname-v-javascript
This file contains hidden or 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 { fileURLToPath } from 'url'; | |
import { dirname } from 'path'; | |
export default () => { | |
const __filename = fileURLToPath(import.meta.url); | |
const __dirname = dirname(__filename); | |
return __dirname; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment