evejsapi
EvE Online Request API
Last updated 3 years ago by dreamwork .
ISC · Repository · Original npm · Tarball · package.json
$ cnpm install evejsapi 
SYNC missed versions from official npm registry.

EvE Online Javascript API

Ein asynchroner EVE Online API Client für Node.js

  • asynchron
  • Promise basierend
  • umfangreiches Caching

Installation

npm install evejsapi --save

Beispiele

XML Client

const evejsapi = require('evejsapi');
console.log(evejsapi);
{
  cache: {
    file: [Function: FileCache],
    memory: [Function: MemoryCache],
    mongo: [Function: MongoDBCache],
    redis: [Function: RedisCache] },
  client: {
    evecentral: [Function: EveCentralClient],
    xml: [Function: XmlClient]
  }
}

Memory Cache

Wenn der Instance des Clients kein Cache Object übergeben wird, so wird default der MemoryCache genutzt.

const evejsapi = require('evejsapi');

const XmlClient = new evejsapi.client.xml();

XmlClient.fetch('server:ServerStatus')
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);

File Cache

Folgende Keys sind möglich

  • path (absoluter Pfad) | default: /tmp/evejsapi-cache
  • prefix | default: ''
...
const XmlClient = new evejsapi.client.xml({
  cache: new evejsapi.cache.file({
    path: '/tmp/evejsapi-cache',
    prefix: ''
  }),
});
...

MongoDB Cache

Folgende Keys sind möglich

  • host | default: localhost
  • port | default: 27017
  • collection | default: evejsapi
  • prefix | default: ''
...
const XmlClient = new evejsapi.client.xml({
  cache: new evejsapi.cache.mongo({
    host: 'localhost',
    port: 27017,
    collection: 'evejsapi',
    prefix: ''
  }),
});
...

Redis Cache

Folgende Keys sind möglich

  • socket

oder

  • host | default: localhost
  • port | default: 6379
  • prefix | default: 'evejsapi.cache'
...
const XmlClient = new evejsapi.client.xml({
  cache: new evejsapi.cache.redis({
    host: 'localhost',
    port: 6379,
    prefix: 'evejsapi.cache'
  }),
});
...

EvE Central Client

Der Client kann folgende Calls ausführen

EvE-Central API https://eve-central.com/home/develop.html

Alle Abfragen werden für 5 Minuten gecached.

  • marketstat
  • quicklook
  • quicklook/onpath
const evejsapi = require('evejsapi');

const XmlClient = new evejsapi.client.xml({
  cache: new evejsapi.cache.redis(),
});

XmlClient.fetch('marketstat', [['typeid', 34]])
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);
...
XmlClient.fetch('marketstat', [['typeid', 34], ['typeid', 35]])
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);
...
XmlClient.fetch('quicklook', [['typeid', 34], ['typeid', 35]])
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);
...
XmlClient.fetch('quicklook', [['typeid', 34], ['typeid', 35], ['usesystem', 30000142]])
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);
...
XmlClient.fetch('quicklook:onpath:from:Jita:to:Amarr:fortype:34')
  .then((data) => {
    console.log('data');

  })
  .catch(console.error);

English Version

Coming Soon

Current Tags

  • 1.1.0                                ...           latest (3 years ago)

5 Versions

  • 1.1.0                                ...           3 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |