It seems that index.js in current 2.4.2 version is not a proper ES module, even though it appears to be intended as one.
The file still has CommonJS semantics, like require and exports.default.
When I try to use it in my ESM environment, importing import wiki from 'wikipedia'; doesn't work.
It returns an object with default in it and I need to unwrap it to access functions like page.
It seems that
index.jsin current 2.4.2 version is not a proper ES module, even though it appears to be intended as one.The file still has CommonJS semantics, like
requireandexports.default.When I try to use it in my ESM environment, importing
import wiki from 'wikipedia';doesn't work.It returns an object with
defaultin it and I need to unwrap it to access functions likepage.