Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

d-wiki

dangjingtao21MIT0.0.1TypeScript support: included

A JavaScript wrapper for the wikipedia apis

wiki, wikipedia, wikimedia, encyclopedia, jest, node-wiki, wiki-node

readme

wikijs

基于nodejs的wiki请求,在 git://github.com/dopecodez/wikipedia.git 基础上增加代理。


const wiki = require("wiki");
(async () => {
  try {
    await wiki.setLang("zh");
    wiki.setProxy(`http://127.0.0.1:1080`);
    // console.log(newUrl);
    const page = await wiki.page("keyword");
    //Response of type @Page object
    const summary = await page.infobox();
    console.log(summary);
    //Response of type @wikiSummary - contains the intro and the main image
  } catch (error) {
    console.log(error);
    //=> Typeof wikiError
  }
})();