Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

cytrus-re/wikipediajs

 
 

Repository files navigation

cytrus-re/wikipediajs

npm code style: prettier

Promise-based Wikipedia API wrapper.

Table of contents

Installation

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" />

Features

  • Search Wikipedia articles in any language
  • Get a random article
  • Get feed for Picture of the day, featured article or 'on this day' articles

Usage

  • 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));

About

Promise-based Wikipedia API wrapper.

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%