Promise-based Wikipedia API wrapper.
Install via npm:
$ npm install @cytrus-re/wikipediajs
...or via a CDN:
<script src="https://unpkg.com/@cytrus-re/wikipediajs/dist/index.umd.min.js" />
- Search Wikipedia articles in any language
- Get a random article
- Get feed for Picture of the day, featured article or 'on this day' articles
-
Import module:
import wiki from "@cytrus-re/wikipediajs";
...or require:
const wiki = require("@cytrus-re/wikipediajs");
-
Search for an article:
wiki .search("savanna hawk") .then((res) => console.log(res)) .catch((error) => console.log(error));
-
Search for an article in a different language:
wiki .search("Veulta a san juan", "es") .then((res) => console.log(res)) .catch((error) => console.log(error));