UNPKG
jiti
Version:
1x (1.21.7)
2x (2.0.0-rc.1)
latest (2.4.2)
2.4.2
2.4.1
2.4.0
2.3.3
2.3.2
2.3.1
2.3.0
2.2.1
2.2.0
2.1.2
2.1.1
2.1.0
2.0.0
2.0.0-rc.1
2.0.0-beta.3
2.0.0-beta.2
2.0.0-beta.1
1.21.7
1.21.6
1.21.5
1.21.4
1.21.3
1.21.2
1.21.1
1.21.0
1.20.0
1.19.3
1.19.2
1.19.1
1.19.0
1.18.2
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.0
1.14.0
1.13.0
1.12.15
1.12.14
1.12.13
1.12.12
1.12.11
1.12.10
1.12.9
1.12.8
1.12.7
1.12.6
1.12.5
1.12.4
1.12.3
1.12.2
1.12.1
1.12.0
1.11.0
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.0
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.0
1.4.0
1.3.0
1.2.1
1.2.0
1.1.0
1.0.0
0.1.20
0.1.19
0.1.18
0.1.17
0.1.16
0.1.15
0.1.14
0.1.13
0.1.12
0.1.11
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.0
Runtime typescript and ESM support for Node.js (CommonJS)
github.com/unjs/jiti
unjs/jiti
jiti
/
lib
/
index.js
16 lines
(11 loc)
•
296 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function
onError
(
err
) {
throw
err
/* ↓ Check stack trace ↓ */
}
module
.
exports
=
function
(
filename, opts
) {
const
jiti =
require
(
'../dist/jiti'
) opts = { onError, ...opts }
if
(!opts.
transform
) { opts.
transform
=
require
(
'../dist/babel'
) }
return
jiti
(filename, opts) }