Skip to content

lipsworld/an-array-of-english-words

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

an-array-of-english-words

An array of ~275,000 English words derived from the Letterpress word list. Works with node and browserify.

Programmatic Usage

To use the module in Javascript code, install it locally:

npm install an-array-of-english-words --save

Then:

const words = require('an-array-of-english-words')
const funWords = words.filter(word => word.match(/^fun/i))
console.log(funWords)

Command Line Usage

There's a CLI that prints all words to STDOUT. Install it globally:

npm i -g an-array-of-english-words

Run words to print all the words to stdout:

words

Use grep to filter by pattern:

words | grep cheese

Use egrep to filter with regular expressions:

words | egrep '^fun'            # start with 'fun'
words | egrep 'ification$'      # end with 'ification'
words | egrep 'ou?r$'           # end in 'or' or 'our'

Use wc to find out how many monkey words there are:

words | grep monkey | wc -l

Ten random ten-letter words:

$ words | egrep '^.{10}$' | gshuf | head -10

Note: On macOS, brew install coreutils to get gshuf and other goodies.

See Also

About

An array of ~275,000 English words derived from the Letterpress word list. Works with Node and Browserify.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%