spell 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -166
- package/package.json +17 -24
- package/.npmignore +0 -4
- package/.travis.yml +0 -6
- package/LICENSE +0 -14
- package/spell.js +0 -347
- package/test/css/mocha.css +0 -110
- package/test/index.html +0 -34
- package/test/lib/JSONStream/.npmignore +0 -3
- package/test/lib/JSONStream/bench.js +0 -35
- package/test/lib/JSONStream/examples/all_docs.js +0 -13
- package/test/lib/JSONStream/index.js +0 -118
- package/test/lib/JSONStream/package.json +0 -13
- package/test/lib/JSONStream/readme.markdown +0 -120
- package/test/lib/JSONStream/test/fixtures/all_docs_include.json +0 -4245
- package/test/lib/JSONStream/test/fixtures/all_npm.json +0 -4030
- package/test/lib/JSONStream/test/parsejson.js +0 -25
- package/test/lib/JSONStream/test/stringify.js +0 -41
- package/test/lib/JSONStream/test/test.js +0 -35
- package/test/lib/JSONStream/test/test2.js +0 -29
- package/test/lib/JSONStream/test/two-ways.js +0 -41
- package/test/lib/jquery-1.7.1.min.js +0 -4
- package/test/lib/json2.js +0 -487
- package/test/lib/mocha-0.3.6.js +0 -2672
- package/test/lib/request/LICENSE +0 -55
- package/test/lib/request/README.md +0 -285
- package/test/lib/request/main.js +0 -618
- package/test/lib/request/mimetypes.js +0 -146
- package/test/lib/request/oauth.js +0 -34
- package/test/lib/request/package.json +0 -15
- package/test/lib/request/tests/googledoodle.png +0 -0
- package/test/lib/request/tests/run.sh +0 -6
- package/test/lib/request/tests/server.js +0 -57
- package/test/lib/request/tests/test-body.js +0 -90
- package/test/lib/request/tests/test-cookie.js +0 -29
- package/test/lib/request/tests/test-cookiejar.js +0 -90
- package/test/lib/request/tests/test-errors.js +0 -30
- package/test/lib/request/tests/test-oauth.js +0 -109
- package/test/lib/request/tests/test-pipes.js +0 -167
- package/test/lib/request/tests/test-proxy.js +0 -39
- package/test/lib/request/tests/test-timeout.js +0 -87
- package/test/lib/request/uuid.js +0 -19
- package/test/lib/request/vendor/cookie/index.js +0 -55
- package/test/lib/request/vendor/cookie/jar.js +0 -72
- package/test/perf.js +0 -44
- package/test/resources/big.js +0 -9
- package/test/resources/big.json +0 -29159
- package/test/resources/big.txt +0 -128457
- package/test/resources/big_browser.js +0 -29159
- package/test/resources/npm.js +0 -26
- package/test/resources/npm.json +0 -84701
- package/test/resources/perf1.js +0 -144
- package/test/resources/perf2.js +0 -366
- package/test/spell.js +0 -295
package/test/resources/npm.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var fs = require('fs')
|
|
3
|
-
, spell = require('../../spell')
|
|
4
|
-
, request = require('../lib/request')
|
|
5
|
-
, JSONStream = require('../lib/JSONStream')
|
|
6
|
-
, dict = spell()
|
|
7
|
-
, get_stream =
|
|
8
|
-
request('http://isaacs.couchone.com/registry/_all_docs?include_docs=true')
|
|
9
|
-
, parse_stream = JSONStream.parse(['rows', /./, 'doc'])
|
|
10
|
-
;
|
|
11
|
-
|
|
12
|
-
get_stream.pipe(parse_stream);
|
|
13
|
-
parse_stream.on('data', function (module) {
|
|
14
|
-
try {
|
|
15
|
-
dict.load(JSON.stringify(module), {reset:false});
|
|
16
|
-
if(module.name)
|
|
17
|
-
dict.add_word(module.name, 10000); // a name is like a 10thousand words
|
|
18
|
-
} catch (e) {
|
|
19
|
-
console.log('!!! ', e);
|
|
20
|
-
console.log('----', JSON.stringify(module));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
parse_stream.on('end', function () {
|
|
24
|
-
console.log('> npm.json');
|
|
25
|
-
fs.writeFileSync('npm.json', JSON.stringify(dict.export(),null,2));
|
|
26
|
-
});
|