UNPKG
es2015-dirname
Version:
latest (1.1.2)
1.1.2
1.1.1
1.1.0
1.0.0
A module for using the __dirname with the "module" type for node
es2015-dirname
/
index.js
20 lines
(10 loc)
•
304 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import
{ fileURLToPath }
from
'url'
;
import
path
from
'path'
;
let
__filename =
""
;
let
__dirname =
""
;
function
config
(
metaUrl
){ __filename =
fileURLToPath
(metaUrl) __dirname = path.
dirname
(__filename) }
export
default
{ config, __dirname}
export
{ config, __dirname}