npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wikipedia-summary

v2.0.0

Published

Wikipedia API wrapper — summaries, search, random articles, On This Day events, multi-language support.

Downloads

38

Readme

wikipedia-summary 📚

Wikipedia API wrapper for Node.js — summaries, search, random articles, On This Day events, multi-language support.

🚀 What's New in v2.0.0

  • search() — Search Wikipedia and get matched articles
  • getRandomArticle() — Discover random Wikipedia articles
  • getOnThisDay() — Historical events, births, deaths for today's date
  • getMultipleSummaries() — Fetch multiple topics at once
  • Thumbnail & image URLs — Both original and thumbnail images
  • Last modified date — Article freshness info
  • Input validation — Better error messages

📦 Installation

npm install wikipedia-summary

📋 Usage

Get Summary

const { getSummary } = require("wikipedia-summary");

const article = await getSummary("Node.js");
console.log(article.title);       // "Node.js"
console.log(article.extract);     // Full summary text
console.log(article.pageUrl);     // Wikipedia page URL
console.log(article.imageUrl);    // Main image URL
console.log(article.thumbnailUrl); // Thumbnail URL
console.log(article.lastModified); // Last edit timestamp

Multi-language Support

const { getSummary } = require("wikipedia-summary");

// Turkish
const tr = await getSummary("Istanbul", "tr");

// German
const de = await getSummary("Berlin", "de");

// Japanese
const ja = await getSummary("Tokyo", "ja");

Search Wikipedia

const { search } = require("wikipedia-summary");

const results = await search("artificial intelligence", "en", 5);
results.forEach(r => {
  console.log(`${r.title} - ${r.snippet}`);
  console.log(`  ${r.pageUrl}`);
});

Random Article

const { getRandomArticle } = require("wikipedia-summary");

const random = await getRandomArticle();
console.log(`${random.title}: ${random.extract}`);

// Random article in Turkish
const randomTR = await getRandomArticle("tr");

On This Day

const { getOnThisDay } = require("wikipedia-summary");

const events = await getOnThisDay("en", "all");
events.forEach(event => {
  console.log(`[${event.type}] ${event.year || ''} - ${event.text}`);
});

// Filter by type: "selected", "births", "deaths", "events", "holidays"
const births = await getOnThisDay("en", "births");

Multiple Summaries

const { getMultipleSummaries } = require("wikipedia-summary");

const topics = ["JavaScript", "Python", "Rust", "Go"];
const summaries = await getMultipleSummaries(topics);

summaries.forEach(s => {
  if (s.error) {
    console.log(`${s.title}: ${s.error}`);
  } else {
    console.log(`${s.title}: ${s.extract.substring(0, 100)}...`);
  }
});

📡 API

| Function | Description | |----------|-------------| | getSummary(topic, lang?) | Get article summary | | search(query, lang?, limit?) | Search Wikipedia articles | | getRandomArticle(lang?) | Get a random article | | getOnThisDay(lang?, type?) | Get On This Day events | | getMultipleSummaries(topics[], lang?) | Batch fetch summaries |

Language Support

All functions accept a language code as parameter. Examples: "en", "tr", "de", "fr", "es", "ja", "zh", "pt", "ru", "ar".

📄 License

MIT © Utku Berkay Koç