UNPKG
import-in-the-middle
Version:
latest (3.2.0)
3.2.0
3.1.0
3.0.2
3.0.1
3.0.0
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.15.0
1.14.4
1.14.3
1.14.2
1.14.1
1.14.0
1.13.2
1.13.1
1.13.0
1.12.0
1.11.3
1.11.2
1.11.1
1.11.0
1.10.0
1.9.1
1.9.0
1.8.1
1.8.0
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.0
1.5.0
1.4.2
1.4.1
1.4.0
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
Intercept imports in Node.js
github.com/nodejs/import-in-the-middle
nodejs/import-in-the-middle
import-in-the-middle
/
test
/
hook
/
v18.19-openai.mjs
17 lines
(12 loc)
•
263 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import
OpenAI
from
'openai'
import
Hook
from
'../../index.js'
Hook
(
(
exports
, name
) =>
{
if
(name ===
'openai'
) {
console
.
assert
(name,
exports
) } })
console
.
assert
(
OpenAI
)
const
openAI =
new
OpenAI
({
apiKey
:
'doesnt-matter'
})
console
.
assert
(openAI)