Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/connor4312/spacegdn-bridge

Node.js bridge for the SpaceGDN
https://github.com/connor4312/spacegdn-bridge

Last synced: about 1 month ago
JSON representation

Node.js bridge for the SpaceGDN

Awesome Lists containing this project

README

        

#SpaceGDN Bridge

This is basically a direct port of the PHP [spacegdn-bridge](https://github.com/MCProHosting/spacegdn-bridge/) and my attempt to learn and play around with Typescript.

Usage Examples:

```js
var Bridge = require('spacegdn-bridge');
var bridge = new Bridge();

// Sets the location of the GDN
bridge.setEndpoint('gdn.api.xereo.net');

// Gets all jars:
bridge.get('jars').results(function (err, data) {
// do something amazing
});

// Gets the second page of jars:
bridge
.get('jars')
.page(2)
.results(function (err, data) {
// do something amazing
});

// Gets all versions owned by jar #2:
bridge
.jar(2)
.get('versions')
.results(function (err, data) {
// do something amazing
});

// Query demonstrating most GDN properties.
bridge
.jar(2)
.get('builds')
.where('build', '>', 1234)
.orderBy('build', 'desc')
.results(function (err, data) {
// do something amazing
});

// "data" is simply the JSON object returned by the GDN.

```