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

@bhsd/codemirror-wikitext

v0.1.0

Published

Wikitext mode based on wikimedia/mediawiki-extensions-CodeMirror and language support extensions

Readme

npm version CodeQL

@bhsd/codemirror-wikitext

This repository contains a modified Wikitext language from MediaWiki extension CodeMirror and various language support extensions.

Installation

You can install the package via npm and import it as a module:

npm install @bhsd/codemirror-wikitext

You may also want to install WikiParser-Node for pre-defined parser configurations:

npm install wikiparser-node

Basic Usage

You can simply import the mediawiki function to get the Wikitext language with full language support:

import {mediawiki} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const langSupport: LanguageSupport = mediawiki(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

Here is an online demo.

Language

mediawikiLanguage

You can import the stream language for Wikitext:

import {mediawikiLanguage} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const lang: StreamLanguage = mediawikiLanguage(config);

Keymap

escapeKeymap

Key bindings:

  • Ctrl/Cmd + [: Escape the selected text with HTML entities
  • Ctrl/Cmd + ]: Escape the selected text with URL encoding
  • Ctrl/Cmd + \: Escape the selected text with magic words
import {escapeKeymap} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const keymap: KeyBinding[] = escapeKeymap(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

formatKeymap

Formatting key bindings:

  • Ctrl + 0: Plain paragraph
  • Ctrl + 1-6: Headings level 1 to 6
  • Ctrl + 7: Preformatted text
  • Ctrl + 8: Blockquote
  • Ctrl/Cmd + /: Comment
  • Ctrl/Cmd + .: Superscript
  • Ctrl/Cmd + ,: Subscript
  • Ctrl/Cmd + B: Bold
  • Ctrl/Cmd + I: Italic
  • Ctrl/Cmd + U: Underline
  • Ctrl/Cmd + K: Wiki link
  • Ctrl + Shift + 5: Strikethrough
  • Ctrl/Cmd + Shift + 6: Inline code
  • Ctrl/Cmd + Shift + K: Ref tag
import {formatKeymap} from '@bhsd/codemirror-wikitext';

const keymap: KeyBinding[] = formatKeymap;

Extensions

bracketMatching

Matched or unmatched brackets or tags are highlighted in cyan or dark red when the cursor is next to them.

import {bracketMatching} from '@bhsd/codemirror-wikitext';

const extension: Extension = bracketMatching();

codeFolding

Fold sections, templates, parser functions and extension tags.

Key bindings:

  • Ctrl + Shift + [/Cmd + Alt + [: Fold at the selected text
  • Ctrl + Shift + ]/Cmd + Alt + ]: Unfold at the selected text
  • Ctrl + Alt + [: Fold all
  • Ctrl + Alt + ]: Unfold all
  • Ctrl + Alt + .: Fold all <ref> tags
import {codeFolding} from '@bhsd/codemirror-wikitext';

const extension: Extension = codeFolding();

colorPicker

Provide color pickers.

import {colorPicker} from '@bhsd/codemirror-wikitext';

const extension: Extension = colorPicker();

hover

Show the help information of a magic word when hovering.

import {hover} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const extension: Extension = hover(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

inlayHints

Show inlay hints for anonymous parameters.

import {inlayHints} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const extension: Extension = inlayHints(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

refHover

Show the content of the <ref> tag defined elsewhere when hovering.

import {refHover} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const extension: Extension = refHover(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

signatureHelp

Show the parser function signature when typing.

import {signatureHelp} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const extension: Extension = signatureHelp(
	config,
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);

wikilint

Provide syntax diagnostics using WikiParser-Node.

import {wikilint} from '@bhsd/codemirror-wikitext';
import config from 'wikiparser-node/config/default.json' with {type: 'json'};

const extension: Extension = wikilint(
	config,
	// (optional) specify the linting rules; see https://github.com/bhsd-harry/wikiparser-node/wiki/Rules#configuration
	// In particular, Stylelint will not be loaded if the 'invalid-css' rule is disabled.
	{'invalid-css': 0},
	// (optional) specify the jsDelivr CDN for loading assets, default to https://testingcf.jsdelivr.net
	'https://cdn.jsdelivr.net',
);