I find it frustrating that the documentation for this library is lacking, making it difficult to figure out how to import it into my Typescript/React project.
I am attempting to utilize the MediaWiki officially supported library but the examples provided are not comprehensive enough.
Despite searching, I cannot find an import statement in the documentation, leading to confusion on my end.
I have attempted the following code:
import mw from 'mediawiki'
console.log(mw)
However, the object returned is unexpected:
Object { version: "0.0.11", Bot: Bot(config) }
Subsequently, I tried the following, attempting to align with the documentation:
const api = new mw.Bot()
The resulting object does not align with the documentation and does not function as expected.
https://i.sstatic.net/6tXp3.png
Why are the docs misleading? I simply want a library that can help me retrieve categories and pages from a MediaWiki site. Am I missing a fundamental concept that other Javascript developers are aware of? As a career software developer, I engage less frequently with Javascript, so I may be overlooking some key details.