siddharthvp / mwn

A JavaScript & TypeScript MediaWiki bot framework for Node.js
https://mwn.toolforge.org
GNU Lesser General Public License v3.0
49 stars 9 forks source link
mediawiki-api-wrapper mediawiki-bot mediawiki-client nodejs-bot

mwn

Node.js CI CodeQL NPM version Coverage Status PRs Welcome

Quick links: Getting StartedGitHubNPMUser DocumentationAPI Documentation

Mwn is a modern and comprehensive MediaWiki bot framework for Node.js, originally adapted from mwbot.

Mwn works with both JavaScript and TypeScript. It is created with a design philosophy of allowing bot developers to easily and quickly write bot code, without having to deal with the MediaWiki API complications and idiosyncrasies such as logins, tokens, maxlag, query continuations and error handling. Making raw API calls is also supported for complete flexibility. Mwn uses JSON with formatversion 2 by default. The axios library is used for HTTP requests.

This library provides TypeScript type definitions for all its functions, as well as for MediaWiki API request objects (MW core + several extensions). API responses are also typed for the common operations.

This library uses mocha and chai for tests, and has extensive test coverage. Testing is automated using a CI workflow on GitHub Actions.

To install, run npm install mwn.

Download stats

Documentation

Up-to-date documentation is hosted on Toolforge.

API documentation (automatically generated via typedoc) is also available at https://mwn.toolforge.org/docs/api.

Features

Compatibility

Mwn is currently compatible with Node.js v10 and above. In the future, compatibility with EOL Node versions may be dropped.

As for MediaWiki support, the CI pipelines only check for compatibility with the latest LTS version. But it should work fine with version 1.35 and above.

Contributing

Patches are very much welcome. See https://mwn.toolforge.org/docs/developing for instructions.

Licensing

Mwn is released under GNU Lesser General Public License (LGPL) v3.0, since it borrows quite a bit of code from MediaWiki core (GPL v2). LGPL is a more permissive variant of GNU GPL. Unlike GPL, it enables this library to be used in software not released under GPL-compatible licenses, and even in proprietary software. However, any derivatives of this library should be released under an GPL-compatible license (like LGPL). That being said, this is not legal advice.