New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

wiki-to-git

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wiki-to-git

Node.js tool for downloading MediaWiki page history and pushing it to a Git repository. Provides commands: wiki2git-load and wiki2git-commit (use -h for help).

latest
npmnpm
Version
1.2.0
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

Wiki to Git

Wiki To Git is a tool that helps to download MediaWiki page history and push it to a Git repository.

You can used it to export things like a Wikipedia gadget to some Git server (e.g. GitHub or GitLab or Gitea). Or just export your user script to Git and work on it locally. The history of the Git repo will preserve authors and original messages (original description of changes). Essentially each edit becomes a commit.

Once done, you can start using external tools to edit and analyze the history of the gadget. You can use Wikiploy to deploy your gadget back to Wikipedia. Testing your code will also be easier with things like Mocha/Chai. You can also use build tools like Browserify or Webpack.

Using tools

Basic steps

Step. 1. Install tools via npm (Node.js):

npm i -g wiki-to-git

Step. 2. Load history metadata from wiki (this will create a history.json file):

wiki2git-load --site meta.wikimedia.org -p "User:Nux/global.js"

To see more options use:

wiki2git-load --help

Step. 3. Commit to a new or existing repo:

wiki2git-commit --site meta.wikimedia.org --repo "global-JS-CSS" -o "global.js"

This will automatically:

  • Create a "global-JS-CSS" repository.
  • Download revisions from the site.
  • Create a file global-JS-CSS/global.js.

That is it. You should check if the history of the git repo is OK and you can push it to your Git server (like e.g. GitHub).

More files

If you want to download more files, just run similar steps again. The repository will be detected, and commits will be added for the new file.

For example you might want to add CSS:

wiki2git-load --site meta.wikimedia.org -p "User:Nux/global.css"
wiki2git-commit --site meta.wikimedia.org --repo "global-JS-CSS" -o "global.css"

Creating a script (not using cmd)

I recommend using cmd tools, but you can also use a Node script if you prefer. See README-classes.md (on Github).

Troubleshooting

Supported Node versions

You'll need Node.js for this tool and your safest choice is the latest LTS version.

Wiki2git 1.1 has been successfully tested with Node versions 14, 16, 18, and 20.

Review git history

If something goes wrong you might want remove the .git subdirectory from the generated repo and try again.

To check the details of the repo use this:

git log --pretty=fuller

This will show more details then typical log. Note that committer should be your Git account and the author should be an author from the Wiki page history.

Keywords

mediawiki

FAQs

Package last updated on 08 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts