-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlists.js
More file actions
25 lines (20 loc) · 600 Bytes
/
Copy pathlists.js
File metadata and controls
25 lines (20 loc) · 600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import alfy from 'alfy';
import * as fs from 'fs';
let rows = fs.readFileSync('/usr/share/dict/words', 'utf-8')
let words = alfy.cache.get('words');
if (words === undefined) {
words = [];
rows.split(/[\r\n]+/).forEach(word => {
if (word.length >= 3 && word.length <= 6) {
words.push(word.toLowerCase());
}
});
alfy.cache.set('words', words);
}
const lists = {
strings: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',
numbers: '0123456789',
punctuation: '!"#$%&\'()*+,-./:;<=>?@[\]^_`{|}~',
words: words
}
export default lists;