get-wikipedia-article
TypeScript icon, indicating that this package has built-in type declarations

0.0.4-alpha.0 • Public • Published

if you getting an error related to Fetch, Node's flag option --no-experimental-fetch may fix the issue

get-wikipedia-article

Fetch Wikipedia article resources (e.g. title, body, links, ...).

Install

  • npm i get-wikipedia-article

Usage

import getWikipediaArticle from 'get-wikipedia-article';

const article = await getWikipediaArticle('harry potter', {
  // options object (optional)
  language: 'es', // ISO 639-1 code (default: 'en')

  include: [
    // default: ['title', 'body']
    'title',
    'body',
    'related',
    'summary',
    'links',
    'categories',
    'description',
    'alias',
    'label',
  ],

  format: 'html', // 'plain' (default) or 'html'
});

console.log(article);

Package Sidebar

Install

npm i get-wikipedia-article

Weekly Downloads

1

Version

0.0.4-alpha.0

License

MIT

Unpacked Size

63.5 kB

Total Files

18

Last publish

Collaborators

  • gusalbukrk