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 ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

@jiltq/wikipedia.js

v1.1.5

Published

๐Ÿ“œ Wikipedia API wrapper

Downloads

2

Readme

wikipedia.js

About

wikipedia.js is a lightweight Node.js module that allows you to easily interact with the Wikipedia REST API

  • Object-oriented
  • Utilizes ES6 features

Installation

npm i @jiltq/wikipedia.js
yarn add @jiltq/wikipedia.js
pnpm add @jiltq/wikipedia.js

Features

  • Fetch page content in different formats
  • Fetch aggregated daily featured content
  • (COMING SOON) Fetch mobile-friendly page content
  • Extensive documentation

Example usage

To get a summary of the movie Shrek:

const wiki = require('@jiltq/wikipedia.js');

(async () => {
    const page = new wiki.Page('Shrek');
    const summary = await page.summary();
    
    console.log(summary);
})();

Example output

{
    type: 'standard',
    title: 'Shrek',
    displaytitle: '<i>Shrek</i>',
    namespace: { id: 0, text: '' },
    wikibase_item: 'Q483815',
    titles: { canonical: 'Shrek', normalized: 'Shrek', display: '<i>Shrek</i>' },
    pageid: 18717177,
    thumbnail: {
        source: 'https://upload.wikimedia.org/wikipedia/en/thumb/3/39/Shrek.jpg/218px-Shrek.jpg',
        width: 218,
        height: 320
    },
    originalimage: {
        source: 'https://upload.wikimedia.org/wikipedia/en/3/39/Shrek.jpg',
        width: 220,
        height: 323
    },
    lang: 'en',
    dir: 'ltr',
    revision: '1061043482',
    tid: '751c5fb0-691b-11ec-8473-cb088b6620a5',
    timestamp: '2021-12-19T08:17:45Z',
    description: '2001 animated film directed by Andrew Adamson and Vicky Jenson',
    description_source: 'local',
    content_urls: {
        desktop: {
            page: 'https://en.wikipedia.org/wiki/Shrek',
            revisions: 'https://en.wikipedia.org/wiki/Shrek?action=history',
            edit: 'https://en.wikipedia.org/wiki/Shrek?action=edit',
            talk: 'https://en.wikipedia.org/wiki/Talk:Shrek'
        },
        mobile: {
            page: 'https://en.m.wikipedia.org/wiki/Shrek',
            revisions: 'https://en.m.wikipedia.org/wiki/Special:History/Shrek',
            edit: 'https://en.m.wikipedia.org/wiki/Shrek?action=edit',
            talk: 'https://en.m.wikipedia.org/wiki/Talk:Shrek'
        }
    },
    extract: 'Shrek is a 2001 American computer-animated comedy film loosely based on the 1990 fairy tale picture book of the same name by William Steig. Directed by Andrew Adamson and Vicky Jenson in their directorial debuts, it stars Mike Myers, Eddie Murphy, Cameron Diaz, and John Lithgow as the voices of the lead characters. The film parodies other fairy tale adaptations, primarily aimed at animated Disney films. The story follows the titular Shrek (Myers), an ogre who finds his swamp overrun by fairy tale creatures who have been banished by the corrupt Lord Farquaad (Lithgow) aspiring to be king. Shrek makes a deal with Farquaad to regain control of his swamp in return for rescuing Princess Fiona (Diaz), whom Farquaad intends to marry. With the help of Donkey (Murphy), Shrek embarks on his quest but soon falls in love with the princess, who is hiding a secret that will change his life forever.',
    extract_html: '<p><i><b>Shrek</b></i> is a 2001 American computer-animated comedy film loosely based on the 1990 fairy tale picture book of the same name by William Steig. Directed by Andrew Adamson and Vicky Jenson in their directorial debuts, it stars Mike Myers, Eddie Murphy, Cameron Diaz, and John Lithgow as the voices of the lead characters. The film parodies other fairy tale adaptations, primarily aimed at animated Disney films. The story follows the titular Shrek (Myers), an ogre who finds his swamp overrun by fairy tale creatures who have been banished by the corrupt Lord Farquaad (Lithgow) aspiring to be king. Shrek makes a deal with Farquaad to regain control of his swamp in return for rescuing Princess Fiona (Diaz), whom Farquaad intends to marry. With the help of Donkey (Murphy), Shrek embarks on his quest but soon falls in love with the princess, who is hiding a secret that will change his life forever.</p>'
}