File tree 1 file changed +37
-3
lines changed
1 file changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,45 @@ There's a CLI that prints all words to STDOUT. Install it globally:
25
25
26
26
``` sh
27
27
npm i -g an-array-of-english-words
28
+ ```
29
+
30
+ Run ` words ` to print all the words to stdout:
31
+
32
+ ``` sh
33
+ words
34
+ ```
35
+
36
+ Use ` grep ` to filter by pattern:
37
+
38
+ ```
28
39
words | grep cheese
29
40
```
30
41
42
+ Use ` egrep ` to filter with regular expressions:
43
+
44
+ ``` sh
45
+ words | egrep ' ^fun' # start with 'fun'
46
+ words | egrep ' ification$' # end with 'ification'
47
+ words | egrep ' ou?r$' # end in 'or' or 'our'
48
+ ```
49
+
50
+ Use ` wc ` to find out how many ` monkey ` words there are:
51
+
52
+ ``` sh
53
+ words | grep monkey | wc -l
54
+ ```
55
+
56
+ Ten random ten-letter words:
57
+
58
+ ``` sh
59
+ $ words | egrep ' ^.{10}$' | gshuf | head -10
60
+ ```
61
+
62
+ Note: On macOS, ` brew install coreutils ` to get
63
+ [ ` gshuf ` ] ( https://en.wikipedia.org/wiki/Shuf ) and other goodies.
64
+
31
65
## See Also
32
66
33
- - [ similar-english-words] ( http ://ghub.io /similar-english-words)
34
- - [ an-array-of-spanish-words] ( https://github.com/zeke /an-array-of-spanish-words )
35
- - [ an-array-of-french-words] ( https://github.com/zeke /an-array-of-french-words )
67
+ - [ similar-english-words] ( https ://github.com/words /similar-english-words)
68
+ - [ an-array-of-spanish-words] ( https://github.com/words /an-array-of-spanish-words )
69
+ - [ an-array-of-french-words] ( https://github.com/words /an-array-of-french-words )
You can’t perform that action at this time.
0 commit comments