Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/warelab/gramene-trees-client
https://github.com/warelab/gramene-trees-client
gramene gramene-search
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/warelab/gramene-trees-client
- Owner: warelab
- License: mit
- Created: 2015-04-03T12:41:54.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-04T20:54:55.000Z (about 3 years ago)
- Last Synced: 2024-12-14T20:04:46.275Z (about 1 month ago)
- Topics: gramene, gramene-search
- Language: JavaScript
- Size: 249 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gramene-trees-client
Provide convenient API for trees. Currently only used for [NCBI taxonomy data](https://www.ncbi.nlm.nih.gov/taxonomy).[![Build Status](https://travis-ci.org/warelab/gramene-trees-client.svg)](https://travis-ci.org/warelab/gramene-trees-client)
[![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://img.shields.io/github/license/mashape/apistatus.svg)
[![Platforms](https://img.shields.io/badge/Platforms-macOS%20%7C%20Linux%20%7C%20Windows%20%7C%20node-lightgrey.svg)](https://img.shields.io/badge/Platforms-macOS%20%7C%20Linux%20%7C%20Windows%20%7C%20node-lightgrey.svg)## Installation
You need to pull down the package via npm. You also can use [yarn](https://github.com/yarnpkg/yarn).```
npm install gramene-trees-client --save
```##Usage
###Promises
```javascript
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](https://babeljs.io) or a library like a library like [q](https://github.com/kriskowal/q)
###Await/Async
```javascript
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](https://babeljs.io) or a library like [asyncawait](https://github.com/yortus/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**