@zonlykroks/eve-esi-client
v0.1.2
Published
Modern TypeScript EVE ESI API wrapper - Complete EVE Online ESI (EVE Swagger Interface) client with TypeScript support, ETag caching, and comprehensive endpoint coverage.
Maintainers
Readme
eve-esi-client
Modern TypeScript EVE ESI API wrapper. Makes getting data from the ESI much easier, avoids cluttering your code with HTTP requests, and is small and powerful.
This is a maintained, typescript alternative to outdated esiJS libraries. Many thanks go to the original creators of these tools, on which this work depends.
Installing
npm install @zonlykroks/eve-esi-clientUsage
const ESIJS = require('@zonlykroks/eve-esi-client')
const esi = new ESIJS({})
// Use all functions like this:
esi.status.status()
.then(response => {
let headers = response.headers
let data = response.data
console.log(`${data.players} players online`)
})
.catch(error => {
console.error('Error:', error.message)
})
// Or with async/await:
try {
let response = await esi.universe.regions.regions()
console.log(`Found ${response.data.length} regions`)
} catch(error) {
console.error('Error:', error.message)
}Authentication
For endpoints requiring authentication, provide your access token:
const esi = new ESIJS({
token: 'your-esi-access-token-here'
})
// Now you can access authenticated endpoints
const wallet = await esi.wallet.character.balance(characterId)
const skills = await esi.skills.skills(characterId)Available Modules
alliance- Alliance informationcharacter- Character data, assets, contacts, mail, etc.corporation- Corporation information and member datauniverse- Static universe data (regions, systems, types, etc.)market- Market orders and pricing datawallet- Wallet operationsskills- Character skills and training queuemail- Mail systemlocation- Character location and ship infostatus- Server statuswars- War information- And more...
Features
- Full TypeScript support with type definitions
- Automatic ETag caching to reduce API calls
- Comprehensive endpoint coverage
- Modern async/await support
- Error handling
TypeScript
import ESIJS from '@zonlykroks/eve-esi-client'
const esi = new ESIJS()
const response = await esi.character.info(123456789)
console.log(response.data.name) // Fully typed