NCBI E-utilities API for JavaScript (Node + Browser)
npm install ncbi-eutilsThis package is a JavaScript wrapper for NCBI's E-utilities API documented at http://www.ncbi.nlm.nih.gov/books/NBK25500/. It uses ES6 promises to support "piping" to combine successive E-utility calls, e.g. piping esearch results to elink, then piping its result to esummary. This can be used in node (CommonJS) or the browser.

![npm version]()
javascript
var eutils = require('ncbi-eutils');
eutils.esearch({db:'gene', term: 'foxp2[sym] AND human[orgn]'})
.then(function(d){console.log(d)})
`Basic data pipelines:
esearch -> esummay
`javascript
eutils.esearch({db:'gene', term: 'ltf[sym] AND human[orgn]'})
.then(eutils.esummary)
.then(function(d){console.log(d)})
`More complex data pipelines:
esearch -> elink -> esummary
`javascript
eutils.esearch({db: 'protein', term: '15718680[UID]'})
.then(eutils.elink({dbto:'gene'}))
.then(function(d) {
//supported eutil parameters can be added like this
d.retstart = 5;
return eutils.esummary(d);
})
.then(function (d) {console.log(d)})
.catch(function (d) {console.log(d)});
`
$3
`javascript
npm install --save ncbi-eutils
`
or in a browser
`html
``All calls in this package return a promise object. To get the return values, pass a function to .then() or .catch() to get the results and errors, respectively. Alternatively, pass another eutil function to .then() to create a data pipeline. For detailed descriptions of each E-utility, please visit NCBI's documentations.
options.db a valid NCBI database name
options.term a valid search term
options.db a valid NCBI database name
options.id array of ids to pass to esummary e.g ['12345', '67890']. Only required if called as the start of a pipeline.
options.db a valid NCBI database name
options.id array of ids to pass to efetch e.g ['12345', '67890']. Only required if called as the start of a pipeline.
options.dbto a valid NCBI database name
options.dbfrom a valid NCBI database name. Only required if called as the start of a pipeline.
options.id array of ids to pass to esummary e.g ['12345', '67890']. Only required if called as the start of a pipeline.