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

mwiki.js

v0.0.2

Published

A simple API wrapper for Wikimedia projects.

Downloads

9

Readme

GitHub Repo stars npm npm

About

mWiki.js is a simple API wrapper which allows you to create beautiful and easy-to-use Wikimedia bots which help you to automate and accelerate your work. You can learn about them here.

Usage

A basic example of parsing a page's content

import { Bot } from 'mwiki.js' // ESModule
const { Bot } = require ('mwiki.js') // CommonJS

const myBot = new Bot ({
    project: 'enwiki', // create a client on the English Wikipedia
    username: 'MyBot', // the username of your bot
    password: '********' // the password of your bot
})

myBot.on ('loggedIn', async (myBot) => {
    const percentagePageWikitext = myBot.parseWikitext ('Batman')

    console.log (percentagePageWikitext)

    /* expected output:

    {{short description|Number or ratio expressed as a fraction of 100}}
    {{pp-semi-indef}}
    {{Redirects|Percent|the symbol|Percent sign}}
    {{Redirects|Per cent|the unit of currency|cent (currency)}}
    {{Use dmy dates|date=October 2020}}
    [[File:Web-browser usage on Wikimedia.svg|thumb|A [[pie chart]] showing the '''percentage''' by web browser visiting [[Wikimedia Foundation|Wikimedia]] sites (April 2009 to 2012)]]

    In [[mathematics]], a '''percentage''' ({{etymology|la|{{wikt-lang|la|per centum}}|by a hundred}}) is a number or [[ratio]] expressed as a [[fraction (mathematics)|fraction]] of 100. It is often [[Denotation|denoted]] using the [[percent sign]] (%),<ref>{{cite web |title=Introduction to Percents |url=https://mathsisfun.com/percentage.html |website=mathsisfun.com |access-date=2020-08-28}}</ref> although the abbreviations ''pct.'', ''pct'', and sometimes ''pc'' are also used.<ref>{{cite news |last=Dakers|first=Marion |date=7 January 2015 |url=https://www.telegraph.co.uk/finance/economics/11329769/Eurozone-officially-falls-into-deflation-piling-pressure-on-ECB.html |title=Eurozone Officially Falls into Deflation, Piling Pressure on ECB |newspaper=[[The Daily Telegraph]] |access-date=2019-12-27}}</ref> A percentage is a [[dimensionless quantity|dimensionless number]] (pure number), primarily used for expressing proportions, but percent is nonetheless a [[unit of measurement]] in its orthography and usage.<ref>{{cite book |last1=Mattock |first1=Peter |title=Conceptual Maths: Teaching 'about' (rather than just 'how to do') mathematics in schools |date=5 January 2023 |publisher=Crown House Publishing Ltd |isbn=978-1-78583-618-3 |page=269 |url=https://www.google.com/books/edition/Conceptual_Maths/FZVfEAAAQBAJ?hl=en&gbpv=1&pg=PT269 |language=en}}</ref>
    ...

    */
})