Skip to content

warelab/gramene-trees-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gramene-trees-client

Provide convenient API for trees. Currently only used for NCBI taxonomy data.

Build Status MIT License Platforms

Installation

You need to pull down the package via npm. You also can use yarn.

npm install gramene-trees-client --save

##Usage

###Promises

 var  treeLoader = grameneTreesClient.promise;
        treeLoader.get().then(function(taxonomy) {
            console.log(taxonomy.model);
        }).catch(function(error) {
            console.error("Error in getting data: ");
        });

Promises-functionality can be obtained from transpilers like babel.js or a library like a library like q

###Await/Async

var treeLoader = require("gramene-trees-client").promise;
var taxonomy = await treeLoader.get();

console.log(taxonomy.model)

Await/Async functionaltiy can be be obtained from transpilers like babel.js or a library like asyncawait. Note, with the asyncawait library, the await and async are functions rather than keywords.

This can be adapted to work in ES2015+ via a transpiler or browsers with native support like in Chrome