Socket
Book a DemoInstallSign in
Socket

wikipedia-titles

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-titles

All the English Wikipedia article titles

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

wikipedia-titles

13 million English Wikipedia article titles, searchable on the command line.

Installation

This module requires Node.js 7 or higher, because it uses async functions.

npm i wikipedia-titles

A postinstall script will download title data from Wikipedia. This file is around 73MB gzipped, and 273MB unzipped.

Programmatic Usage

const stream = require('wikipedia-titles')
stream
  .on('data', (title) => {
    console.log(title)
  })
  .on('end', () => {
    console.log('done!')
  })

CLI Usage

Install it globally:

npm i -g wikipedia-titles

Now you'll have a command called wikipedia-titles on your PATH, and another called wt for convenience.

Count all titles:

wt | wc -l
13556168

You can optionally specify a string to match. Results are not case sensitive.

wt magnetism

Animal_magnetism
Antiferrimagnetism
Antiferromagnetism
Archaeomagnetism
Asperomagnetism
Bio-magnetism
Bioelectromagnetism
Biomagnetism
...

Pass the --urls option for full URLs. If you're using a fancy terminal like Hyper

wt solar --urls    

https://en.wikipedia.org/wiki/.solar
https://en.wikipedia.org/wiki/160-minute_solar_cycle
https://en.wikipedia.org/wiki/1859_solar_superstorm
https://en.wikipedia.org/wiki/1878_solar_eclipse
https://en.wikipedia.org/wiki/1919_solar_eclipse
https://en.wikipedia.org/wiki/1986_solar_eclipse
https://en.wikipedia.org/wiki/2009_solar_eclipse
https://en.wikipedia.org/wiki/2013_Kerala_solar_panel_scam
https://en.wikipedia.org/wiki/2017_US_solar_eclipse
...

Using open and pick, you can pipe results into a keyboard-selectable set.

open $(wt electromagnet --urls | pick)

Dependencies

  • byline: simple line-by-line stream reader
  • minimist: parse argument options
  • nugget: minimalist wget clone written in node. HTTP GETs a file and saves it to the current working directory

Dev Dependencies

  • jest: Delightful JavaScript Testing.
  • mocha: simple, flexible, fun test framework
  • standard: JavaScript Standard Style
  • semantic-release: Automated semver compliant package publishing
  • travis-deploy-once: Run a deployment script only once in the Travis test matrix

License

MIT

FAQs

Package last updated on 19 Feb 2018

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