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

wikitext

v0.0.2

Published

<div align="center">

Readme

Wikitext

A zero-dependency wikitext parser for JavaScript.

GitHub npm

Description

This library allows you to parse wikitext to extract values or manipulate the contents. It turns raw MediaWiki-style wikitext into a structured, machine-friendly representation you can explore, transform, lint, or post-process however you want.

This project is actuvely evolving. Although the API is expected to remain stable and focus mostly in finding edge-cases or supporting other wikitext elements, breaking changes may occur until 1.0.

Features

  • Parses common wikitext constructs, like headings, links, and templates.
  • Produces a clean, navigable AST.
  • Zero dependencies.
  • Written in TypeScript.

Design

The resulting AST is inspired in the HTMLElement structure. All elements (except TextNodes) can have children for their values; some structures, such as TemplateNodes, can have multiple groups of children: one for its name and other for its parameters.

All nodes implement their own toString method to turn the AST back into wikitext. You can modify any of the nodes’ children and get the resulting wikitext back.

At the current version, this library does not support some complex wikitext elements such as wikitables and HTML tags that are usually supported in wikitext.

This project does not try to be a resilient parser and will throw an error when it finds wikitext it can’t understand.

Installation

npm install wikitext
yarn add wikitext

Usage

import { parse } from 'wikitext';

function main() {
  const source = `{{Item Infobox
| name = Item Name
| price = {{Price|200}}
}}
'''Item Name''' is an item in [[game]]. `;
  const page = parse(source);

  const price = page.findTemplate(/price/i)
  if (!price) return;

  price.set(1, '300');
  console.log(`${page}`)
}

Calling the previous function will print in the console:

{{Item Infobox
| name = Item Name
| price = {{Price|300}}
}}
'''Item Name''' is an item in [[game]].

Use cases

  • Format pages.
  • Extract information from pages, e.g. collecting values in specific templates’ parameters.
  • Updating information in pages, e.g. templates’ parameters.

License

MIT