1.3.2 • Published 6 years ago

rawger v1.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Installation

# with npm
npm i --save rawger

#with yarn
yarn add rawger

Documentation

Full documentation is available here

Usage Examples

Check examples folder for more usage examples

Unauthenticated client

const Rawger = require('rawger');

// initialize rawger with default 60s cache
// you can supply a different timeout (check examples folder)
// or use rawger.purgeCache(); to force-clear the cache altogether
// ⚠ starting with v1.1 you need to always await the init process
const rawger = await Rawger();
const { users } = rawger;

// get "Currently Playing" games for user
const playing = (await users('orels1').games('playing')).get();

// get count of owned games
const owned = (await users('orels1').games('owned')).count();

// get raw api response object for "Want to Play" games
const raw = (await users('orels1').games('toplay')).raw();

// get user profile
const profile = (await users('orels1').profile()).get();

Authenticated client

You can also initialize an authenticated client to perform such actions as game status updates, reviews publishing and so on.

const Rawger = require('rawger');

// make sure to `await` the init process
const rawger = await Rawger({
  email: 'some@email.com',
  password: 'do-not-share-this'
});
const { users } = rawger;

// set FarCry 5 to "Currently Playing" for current account
await users('orels1').update().game('23585', { status: 'playing'});
1.3.2

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago