1.7.0 • Published 3 years ago

r6-api-caching v1.7.0

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

r6-api-caching

Simple cacher around r6api.js using redis and mongodb.

NPM

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]
1.6.2

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago