Give me a term and I'll give you a list of links found in its Wikipedia article
This module requires Node.js 8 or higher, because it uses async functions.
Install as a module for programmatic use in your JavaScript code:
npm i wikipedia-hyperlinks --save
Or install as a command-line tool:
npm i -g wikipedia-hyperlinks
The module exports a single async function which expects a search string:
const wh = require('wikipedia-hyperlinks')
wh('Pierre Curie').then(links => {
console.log(links.slice(0, 10))
// Paris
// University of Paris
// Radioactivity
// Curie-Weiss law
// Curie constant
// Curie temperature
// Piezoelectricity
// Marie Skłodowska-Curie
// Irène Joliot-Curie
})
If no match is found, an empty array is returned.
If you install the module globally, you'll have a command called
wikipedia-hyperlinks on your PATH, and another called wh for convenience.
Enter a term:
wh Pierre Curie | head
Paris
University of Paris
Radioactivity
Curie-Weiss law
Curie constant
Curie temperature
Piezoelectricity
Marie Skłodowska-Curie
Irène Joliot-Curie
npm install
npm test
MIT