A Node.js module to fetch data from the NosRanking API.
To install the module, run the following command:
npm install @earlam/nosranking-module
Here’s how to use the module to get data from the NosRanking API:
const { fetchRanking } = require('@earlam/nosranking-module');
// Example usage
fetchRanking('fr', 1, 'Earlam')
.then(data => {
console.log(data);
})
.catch(error => {
console.error('Error:', error);
});
This function retrieves player rankings from the NosRanking API.
- region:
string
- The region to use. Available options:fr
,de
,en
,us
,int
. - server:
number
- The server to use (e.g., 1 forEU-Dragonveil
, 2 forUS-Cylloan
). - nick:
string
- The player's nickname whose data you want to retrieve.
To get the ranking of a player on the French server:
fetchRanking('fr', 1, 'Earlam')
.then(data => {
console.log(data);
});
Contributions are welcome! If you have ideas or improvements, feel free to open an issue or pull request.
Distributed under the MIT License. See LICENSE
for more information.
For any questions, feel free to contact me via my GitHub profile.