# albion

> NodeJS module to interact with the Albion Online API

Latest version **0.3.1** (published 2024-01-10) · LGPL-2.1-or-later license · 0 weekly downloads

## Install

```sh
npm install albion
pnpm add albion
yarn add albion
bun add albion
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2024-01-10 |
| First published | 2023-03-06 |
| Weekly downloads | 0 |
| License | LGPL-2.1-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 39.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Emslay |
| Maintainers | alladeila |
| Keywords | albion, api, albion, online |

## Links

- npm: https://www.npmjs.com/package/albion
- Repository: https://github.com/Alladeila/albion
- Homepage: https://github.com/emslay/albion#readme
- Issues: https://github.com/emslay/albion/issues
- npm.io page: https://npm.io/package/albion

## Recent versions

- 0.3.1 (latest) — 2024-01-10
- 0.3.0 — 2023-03-16
- 0.2.0 — 2023-03-07
- 0.1.1 — 2023-03-07
- 0.1.0 — 2023-03-06

## README

# Albion API
NodeJS module to interact with the [Albion Online API](https://www.tools4albion.com/api_info.php).<br>
Currenly limited in scope, aiming at nearly full (known, see [this](https://www.tools4albion.com/api_info.php)) coverage.<br>
This project is **not recomended for production** in this stage of developement, a lot of breaking-changes are expected in the following versions.<br>
*Note: **Not affiliated with neither Albion Online nor Sandbox Interactive.***
## Instalation
```sh
npm install albion
```
## Example
```js
const AlbionAPI = require('albion');

const playerName = 'aurora60';

AlbionAPI.getPlayerByName(playerName).then(player => {
    if(player === null) return console.log('Player not found!');

    if(player.guild !== null) console.log(`The name of ${player.name}'s guild is ${player.guild.name}.`);
    else console.log(`${player.name} doesn't have a guild.`);
});
```
## Docs
Not ready yet! But you can try these functions while you wait:
- `AlbionAPI.getPlayerById(id);`
- `AlbionAPI.getPlayerByName(name);`
- `AlbionAPI.getGuildById(id);`
- `AlbionAPI.getGuildByName(name);`
- `AlbionAPI.getAllianceById(id);`

*hint: loot at [this file](./typings/index.d.ts)*

---
_Source: https://npm.io/package/albion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
