2.1.6 • Published 8 years ago

gw2_api_miniwrapper v2.1.6

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

GuildWars 2 API Wrapper

Lightweight, simple to use GuildWars 2 API Wrapper

Version

2.1.6

Added Browser support (webpack / browserify)

How to Install

npm i gw2_api_miniwrapper --save

To transpile / test:

git clone https://github.com/mievstac/gw2_api_miniwrapper.git
cd gw2_api_miniwrapper
npm install

Transpile Es6 --> Es5

npm install -g gulp
cd gw2_api_miniwrapper
gulp default

How to use

In depth Wiki: https://github.com/mievstac/gw2_api_miniwrapper/wiki

ES 6

import gw2Api from 'gw2_api_miniwrapper';

gw2Api({
    endpoints: 'items'
}).then(function (items) {
    console.log(items);
}).catch(function (error) {
    console.log(error);
});

ES 5

var gw2Api = require('./index').default;

gw2Api({
    endpoints: 'items'
}).then(function (items) {
    console.log(items);
}).catch(function (error) {
    console.log(error);
});

Examples

import gw2Api from 'gw2_api_miniwrapper';

gw2Api({ // get All items
    endpoints: 'items'
}).then(function (items) {
    console.log(items);
}).catch(function (error) {
    console.log(error);
});

gw2Api({ // get items 1 and 2
    endpoints: 'items',
    ids: [1, 2]
}).then(function (items) {
    console.log(items);
}).catch(function (error) {
    console.log(error);
});

gw2Api({ //search for recipe input, ID 46731
    endpoints: ['recipes','search'],
    input: '46731' //switch to output: <ID> for output
}).then(function(data){
    console.log(data);
})

gw2Api({  // Account endpoint (apiKey required)
    endpoints: 'account',
    apiKey: 'APIKEY_HERE'
}).then(function (data) {
    console.log(data);
}).catch(function (error) {
    console.log(error);
})

Todos

  • TESTS

License

MIT

2.1.6

8 years ago

2.1.5

8 years ago

2.1.4

8 years ago

2.1.3

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago