Socket
Socket
Sign inDemoInstall

get-wikipedia-article

Package Overview
Dependencies
8
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    get-wikipedia-article

Fetch Wikipedia article resources.


Version published
Maintainers
1
Created

Readme

Source

get-wikipedia-article

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

Basic Usage

import getWikipediaArticle from 'get-wikipedia-article';

(async function () {
  const article = await getWikipediaArticle('harry potter');

  console.log(article);
})();

Optional parameters

  • includes = array containing which resources to fetch
    • valid options: title, body, related, summary, links categories, terms, description, alias
    • default value: ['title', 'body']
  • options = object containing miscellaneous options
    • bodyFormat = plain (default) or html

Todo

  • replace all encodeURIComponent calls with URL constructor
  • implement warnings about:
    • progress (warning when starting to fetch each resource)
    • getArticleTerms doesn't return all terms requested

Keywords

FAQs

Last updated on 15 Jan 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc