dictionary-en-us
Advanced tools
Comparing version
32
index.js
@@ -1,27 +0,27 @@ | ||
var read = require('fs').readFile; | ||
var join = require('path').join; | ||
var read = require('fs').readFile | ||
var join = require('path').join | ||
module.exports = load; | ||
module.exports = load | ||
function load(callback) { | ||
var pos = -1; | ||
var exception = null; | ||
var result = {}; | ||
var pos = -1 | ||
var exception = null | ||
var result = {} | ||
one('aff'); | ||
one('dic'); | ||
one('aff') | ||
one('dic') | ||
function one(name) { | ||
read(join(__dirname, 'index.' + name), function (err, doc) { | ||
pos++; | ||
exception = exception || err; | ||
result[name] = doc; | ||
read(join(__dirname, 'index.' + name), function(err, doc) { | ||
pos++ | ||
exception = exception || err | ||
result[name] = doc | ||
if (pos) { | ||
callback(exception, exception ? null : result); | ||
exception = null; | ||
result = null; | ||
callback(exception, exception ? null : result) | ||
exception = null | ||
result = null | ||
} | ||
}); | ||
}) | ||
} | ||
} |
{ | ||
"name": "dictionary-en-us", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "English (United States) spelling dictionary in UTF-8", | ||
@@ -11,2 +11,4 @@ "license": "(MIT AND BSD)", | ||
"dictionary", | ||
"en", | ||
"us", | ||
"english", | ||
@@ -16,3 +18,3 @@ "united", | ||
], | ||
"repository": "wooorm/dictionaries", | ||
"repository": "https://github.com/wooorm/dictionaries/tree/master/dictionaries/en-US", | ||
"bugs": "https://github.com/wooorm/dictionaries/issues", | ||
@@ -19,0 +21,0 @@ "author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", |
@@ -5,12 +5,11 @@ # dictionary-en-us | ||
Useful with [hunspell][hunspell] ([node bindings][nodehun] or | ||
[plain javascript][nspell]), Open Office, LibreOffice, FireFox and | ||
Thunderbird, or [place them in `~/Library/Spelling`][osx] on OS X. | ||
Useful with [hunspell][], [`nodehun`][nodehun], [`nspell`][nspell], | ||
Open Office, LibreOffice, FireFox and Thunderbird, or [macOS][]. | ||
Generated by [**wooorm/dictionaries**][dictionaries], from [this | ||
dictionary][source]. | ||
Generated by [`dictionaries`][dictionaries], from | ||
[`wordlist.aspell.net`][source]. | ||
## Installation | ||
[npm][npm]: | ||
[npm][]: | ||
@@ -24,6 +23,6 @@ ```bash | ||
```js | ||
var enUS = require('dictionary-en-us'); | ||
var enUS = require('dictionary-en-us') | ||
enUS(function (err, result) { | ||
console.log(err || result); | ||
console.log(err || result) | ||
}); | ||
@@ -45,8 +44,7 @@ ``` | ||
```js | ||
var path = require('path'); | ||
var base = require.resolve('dictionary-en-us'); | ||
var path = require('path') | ||
var base = require.resolve('dictionary-en-us') | ||
// NEVER USE `readFileSync` IN PRODUCTION. | ||
fs.readFileSync(path.join(base, 'index.dic'), 'utf-8'); | ||
fs.readFileSync(path.join(base, 'index.aff'), 'utf-8'); | ||
fs.readFileSync(path.join(base, 'index.dic'), 'utf-8') | ||
fs.readFileSync(path.join(base, 'index.aff'), 'utf-8') | ||
``` | ||
@@ -56,6 +54,6 @@ | ||
Dictionary and affix file: [(MIT AND BSD)](https://github.com/wooorm/dictionaries/blob/master/dictionaries/en_US/LICENSE). | ||
Dictionary and affix file: [(MIT AND BSD)](https://github.com/wooorm/dictionaries/blob/master/dictionaries/en-US/LICENSE). | ||
Rest: MIT © [Titus Wormer][home]. | ||
[hunspell]: http://hunspell.sourceforge.net | ||
[hunspell]: http://hunspell.github.io | ||
@@ -66,3 +64,3 @@ [nodehun]: https://github.com/nathanjsweet/nodehun | ||
[osx]: https://github.com/wooorm/dictionaries#os-x | ||
[macos]: https://github.com/wooorm/dictionaries#macos | ||
@@ -69,0 +67,0 @@ [source]: http://wordlist.aspell.net/dicts/ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
569894
0.54%69
-2.82%