Comparing version 0.1.0 to 0.2.0
@@ -0,1 +1,2 @@ | ||
const repl = require('repl'); | ||
@@ -2,0 +3,0 @@ const open = require('open'); |
{ | ||
"name": "node-ncbi", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Access and parse the NCBI eUtils API in Node or the Browser", | ||
@@ -26,3 +26,2 @@ "keywords": [ | ||
"dependencies": { | ||
"gulp-util": "^3.0.7", | ||
"popsicle": "^0.5.12", | ||
@@ -36,2 +35,3 @@ "underscore": "^1.8.3", | ||
"gulp-mocha": "^2.1.2", | ||
"gulp-util": "^3.0.7", | ||
"mocha": "^2.2.5", | ||
@@ -38,0 +38,0 @@ "open": "0.0.5" |
@@ -29,5 +29,7 @@ # node-ncbi | ||
```js | ||
pubmedSearch.nextPage().then( ... ); | ||
pubmedSearch.getPage(1).then( ... ); | ||
``` | ||
**Note**: An earlier version used `pubmedSearch.nextPage` without an argument. I decided that storing this one tiny piece of state in the controller was stupid. | ||
To change the number of results retrieved at a time: | ||
@@ -34,0 +36,0 @@ |
@@ -19,4 +19,3 @@ const _ = require('underscore'); | ||
query: '', | ||
settings: null, | ||
currentPage: -1 | ||
settings: null | ||
}; | ||
@@ -35,3 +34,2 @@ | ||
var search = createGateway.pubmedSearch(this.query, firstResult, lastResult); | ||
console.log(search.generateUrl()); | ||
@@ -46,11 +44,5 @@ return search.resolve().then(eSearchDocument => { | ||
/** | ||
* nextPage - get the next page of results. | ||
* Starting at 0, you can retrieve all results by calling nextPage sequentially. | ||
* @return a promise which will resolve to a page's-worth of result summaries. | ||
* Alias for getPage that gets the first page of results. | ||
*/ | ||
SearchCtlr.nextPage = SearchCtlr.search = function() { | ||
this.currentPage++; | ||
var page = this.getPage(this.currentPage); | ||
return page; | ||
} | ||
SearchCtlr.search = () => {return SearchCtlr.getPage(0)}; | ||
@@ -57,0 +49,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
const _ = require("underscore"); | ||
const _ = require('underscore'); | ||
@@ -3,0 +3,0 @@ /** |
const parseString = require('xml2js').parseString; | ||
const _ = require("underscore"); | ||
const _ = require('underscore'); | ||
@@ -4,0 +4,0 @@ const DocumentTypes = { |
@@ -1,2 +0,2 @@ | ||
"strict mode"; | ||
'strict mode'; | ||
@@ -44,3 +44,3 @@ const _ = require('underscore'); | ||
var idString = _.isArray(ids) ? ids.join() : ids; | ||
return this.addParams({id : idString}); | ||
return this.addParams({id: idString}); | ||
} | ||
@@ -77,4 +77,4 @@ | ||
return popsicle({ | ||
method : 'GET', | ||
url : url | ||
method: 'GET', | ||
url: url | ||
}); | ||
@@ -116,6 +116,6 @@ } | ||
gateway.settings = _.extend({ | ||
documentType : 'esearch', | ||
responseType : 'json', | ||
params : {}, | ||
test : false | ||
documentType: 'esearch', | ||
responseType: 'json', | ||
params: {}, | ||
test: false | ||
}, args); | ||
@@ -122,0 +122,0 @@ gateway.addParams({retmode: gateway.settings.responseType}); |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -31,6 +31,6 @@ const createGateway = require('./createGateway'); | ||
pubmedSummary: function(ids) { | ||
let gateway = createGateway({ | ||
documentType : 'esummary', | ||
params : { | ||
db : 'pubmed' | ||
const gateway = createGateway({ | ||
documentType: 'esummary', | ||
params: { | ||
db: 'pubmed' | ||
} | ||
@@ -47,7 +47,7 @@ }); | ||
pubmedRecord: function(ids) { | ||
let gateway = createGateway({ | ||
documentType : 'efetch', | ||
responseType : 'xml', | ||
params : { | ||
db : 'pubmed' | ||
const gateway = createGateway({ | ||
documentType: 'efetch', | ||
responseType: 'xml', | ||
params: { | ||
db: 'pubmed' | ||
} | ||
@@ -66,6 +66,6 @@ }); | ||
pubmedLinks: function(id) { | ||
let gateway = createGateway({ | ||
documentType : 'elink', | ||
params : { | ||
db : 'pubmed', | ||
const gateway = createGateway({ | ||
documentType: 'elink', | ||
params: { | ||
db: 'pubmed', | ||
dbfrom: 'pubmed', | ||
@@ -72,0 +72,0 @@ cmd: 'neighbor' |
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
/* eslint-env mocha, node */ | ||
/*eslint-env mocha */ | ||
//test the tests | ||
var assert = require("assert") | ||
describe('Array', function(){ | ||
describe('#indexOf()', function(){ | ||
var assert = require('assert') | ||
describe('Array', function() { | ||
describe('#indexOf()', function() { | ||
it('should return -1 when the value is not present', function(){ | ||
@@ -10,0 +8,0 @@ assert.equal(-1, [1,2,3].indexOf(5)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
126
82154
6
2137
- Removedgulp-util@^3.0.7
- Removedansi-gray@0.1.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedansi-wrap@0.1.0(transitive)
- Removedarray-differ@1.0.0(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedbeeper@1.1.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedclone@1.0.4(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removeddateformat@2.2.0(transitive)
- Removedduplexer2@0.0.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfancy-log@1.3.3(transitive)
- Removedglogg@1.0.2(transitive)
- Removedgulp-util@3.0.8(transitive)
- Removedgulplog@1.0.0(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhas-gulplog@0.1.0(transitive)
- Removedlodash._basecopy@3.0.1(transitive)
- Removedlodash._basetostring@3.0.1(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._reescape@3.0.0(transitive)
- Removedlodash._reevaluate@3.0.0(transitive)
- Removedlodash._reinterpolate@3.0.0(transitive)
- Removedlodash._root@3.0.1(transitive)
- Removedlodash.escape@3.2.0(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.template@3.6.2(transitive)
- Removedlodash.templatesettings@3.1.1(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmultipipe@0.1.2(transitive)
- Removedobject-assign@3.0.0(transitive)
- Removedparse-node-version@1.0.1(transitive)
- Removedreadable-stream@1.1.14(transitive)
- Removedreplace-ext@0.0.1(transitive)
- Removedsparkles@1.0.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtime-stamp@1.1.0(transitive)
- Removedvinyl@0.5.3(transitive)