r6-api-caching
v1.7.0
Published
Rainbow Six Siege data caching
Downloads
13
Readme
r6-api-caching
Simple cacher around r6api.js using redis and mongodb.
Install
npm install r6-api-caching
Usage
import { R6Service } from 'r6-api-caching';
const r6Service = new R6Service('email', 'password');
const platform = 'uplay';
const username = 'Godly';
const id = await r6Service.getId(platform, username);
console.log(`Player id : ${id}`);
Player id : be3313d6-d443-4eae-818f-bb7f56837781
With Redis & Mongodb
import { R6Service, CacheService, MongoDatabase } from 'r6-api-caching';
const r6Service = new R6Service('email', 'password', {
caching: true,
expiration: 10 * 60 * 1000 // 10 minutes (default is 1 minute)
cacheService: new CacheService(
"redis://localhost:6379"
),
database: new MongoDatabase(
"mongodb://root:password@localhost:27017"
)
});
const platform = 'uplay';
const username = 'Godly';
const id = await r6Service.getId(platform, username);
console.log(`Player id : ${id}`);
Player id : be3313d6-d443-4eae-818f-bb7f56837781
Dev
Create a .env
file to start the tests.
EMAIL=[UBISOFT ACCOUNT EMAIL]
PASSWORD=[UBISOFT ACCOUNT PASSWORD]