bionode-ncbi
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -34,2 +34,3 @@ // # bionode-ncbi | ||
var tool = require('tool-stream') | ||
var debug = require('debug')('bionode-ncbi') | ||
@@ -42,3 +43,3 @@ | ||
this.DEFAULTS = 'retmode=json&version=2.0' | ||
this.RETURNMAX = 1000 | ||
this.RETURNMAX = 500 | ||
this.XMLPROPERTIES = { | ||
@@ -98,7 +99,18 @@ 'sra': ['expxml', 'runs'], | ||
].join('&') | ||
var getUIDs = _requestData(db) | ||
request({ uri: query, json: true }) | ||
debug('esearch request', query) | ||
var req = request({ uri: query, json: true }) | ||
req.on('response', function(resp) { | ||
debug('esearch response', resp.statusCode) | ||
}) | ||
req | ||
.pipe(JSONStream.parse()) | ||
.pipe(_requestsSplit(db)) | ||
.pipe(getUIDs) | ||
_attachStandardEvents(getUIDs, self, next) | ||
@@ -111,2 +123,3 @@ } | ||
function transform(obj, enc, next) { | ||
debug('esearch results', obj) | ||
var self = this | ||
@@ -151,4 +164,12 @@ var webenv = obj.esearchresult.webenv | ||
} | ||
request({uri: query, json: true}) | ||
debug('esummary request', query) | ||
var req = request({uri: query, json: true}) | ||
req.on('response', function(resp) { | ||
debug('esummary response', resp.statusCode) | ||
}) | ||
req | ||
.pipe(JSONStream.parse()) | ||
@@ -205,3 +226,5 @@ .pipe(tool.extractProperty('result')) | ||
var getLink = tool.attachToObject(link, 'destUID') | ||
debug('elink request', query) | ||
request({ uri: query, json: true }) | ||
@@ -324,2 +347,3 @@ .pipe(_wait(500)) | ||
if (!fs.existsSync(path)) { | ||
debug('downloading', obj.url) | ||
dld(obj.url, folder, chunkSize) | ||
@@ -326,0 +350,0 @@ .on('data', log) |
{ | ||
"name": "bionode-ncbi", | ||
"description": "Node.js module for working with the NCBI API (aka e-utils) using Streams.", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"homepage": "http://github.com/bionode/bionode-ncbi", | ||
@@ -27,8 +27,9 @@ "repository": { | ||
"devDependencies": { | ||
"coveralls": "~2.6.1", | ||
"debug": "^1.0.2", | ||
"docco": "~0.6.2", | ||
"istanbul": "~0.2.4", | ||
"mocha": "~1.17.0", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"should": "~3.0.1", | ||
"istanbul": "~0.2.4", | ||
"coveralls": "~2.6.1", | ||
"docco": "~0.6.2" | ||
"should": "~3.0.1" | ||
}, | ||
@@ -35,0 +36,0 @@ "keywords": [ |
434237
1336
7