Socket
Book a DemoInstallSign in
Socket

wikipedia-hyperlinks

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikipedia-hyperlinks

Give me a term and I'll give you a list of links found in its Wikipedia article

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Give me a term and I'll give you a list of links found in its Wikipedia article

Installation

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

Module Usage

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.

CLI Usage

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

Tests

npm install
npm test

Dependencies

  • cheerio: Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • got: Simplified HTTP requests
  • lodash: Lodash modular utilities.
  • minimist: parse argument options
  • urldecode: Decode url

Dev Dependencies

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework
  • nixt: Simple and powerful testing for command-line apps
  • standard: JavaScript Standard Style
  • standard-markdown: Test your Markdown files for Standard JavaScript Style™

License

MIT

FAQs

Package last updated on 30 Nov 2017

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