Skip to content

Commit

Permalink
Update dirname til
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelazaroff committed Nov 16, 2023
1 parent b09fca3 commit bc0d02c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nodejs/get-dirname-in-esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ import { fileURLToPath } from "node:url";

const __dirname = dirname(fileURLToPath(import.meta.url));
```
**Update:** As of [Node 21.2.0](https://nodejs.org/en/blog/release/v21.2.0), `__filename` and `__dirname` are natively available as `import.meta.filename` and `import.meta.dirname`, respectively.

0 comments on commit bc0d02c

Please sign in to comment.