Created
July 26, 2019 15:00
-
-
Save hubgit/19727c3d12e618c810abdee4cb2780ba to your computer and use it in GitHub Desktop.
Fetch and decompress a Wikidata dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| const https = require('https') | |
| const unbzip2Stream = require('unbzip2-stream') | |
| const url = | |
| 'https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.json.bz2' | |
| const decompress = unbzip2Stream() | |
| const output = fs.createWriteStream('data/latest.json') | |
| https.get(url, res => { | |
| res.pipe(decompress).pipe(output) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment