npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

raapijs

v0.1.2

Published

retroachievement.org unofficial wrapper for their php api

Downloads

21

Readme

RetroAchievements.org Javascript API wrapper

This is a JS wrapper over their already PHP API to access RetroAchievements API API easly with javascript. The API has 0 dependencies only vanilla javascript.

Usage

Import module into your file:
const raApi = require('raapijs');

Authentication to the RetroAchievements site must be done so you should first create an account so you can user your user and api key.

If you already have an account or have done the above step you need to authenticate:

const user = 'username'; // get your username from retroachivements.org
const apiKey = 'yourApiKey'; // get your api key from retroachivements.org profile page
const raApi = new RaApi(user,apiKey); // initialize the module

Once the module has been initialzied you can easly use it by calling the require api call function. Each function is a promise function and it can be called like:

// Get top ten users from [RetroAchievements](retroachievements.org)
raApi.getTopTenUsers().then((users)=>{
    console.log(users); // Returns
        [
        {
        	'1': 'MaxMilyin',
        	'2': '413059',
        	'3': '1299618'
        },
        {
        	'1': 'HippopotamusRex',
        	'2': '354656',
        	'3': '1229216'
        },
        {
        	'1': 'BerserkerBR',
        	'2': '311072',
        	'3': '950623'
        },
        {
        	'1': 'sigma62',
        	'2': '277591',
        	'3': '654364'
        },
        {
        	'1': 'Wendigo',
        	'2': '266284',
        	'3': '1022807'
        },
        {
        	'1': 'Veritasu',
        	'2': '225254',
        	'3': '499926'
        },
        {
        	'1': 'oakley',
        	'2': '218141',
        	'3': '474658'
        },
        {
        	'1': 'SeredaVadim',
        	'2': '204732',
        	'3': '631451'
        },
        {
        	'1': 'FabricioPrie',
        	'2': '204336',
        	'3': '473600'
        },
        {
        	'1': 'GOGZero',
        	'2': '201411',
        	'3': '434551'
        }]

})

Avaiable methods

General

getTopTenUsers()

getConsoleIDs()

Game

/*
	@consoleId number
*/
getGameList(consoleID)
/*
	@consoleId number
*/
getGameInfo( gameID )
/*
	@consoleId number
*/
getGameInfoExtended( gameID )
/*
	@user string
	@consoleId number
*/
getGameInfoAndUserProgress( user, gameID )

User

/*
	@user string
	@consoleId number
*/
getUserRankAndScore( user )
/*
	@user string
	@numGames number
*/
getUserRecentlyPlayedGames( user, numGames )
/*
	@user string
	@gamesCSV number
*/
getUserProgress( user, gamesCSV )
/*
	@user string
	@numRecentGames number
*/
getUserSummary( user, numRecentGames )
/*
	@user string
	@numRecentActivities number
*/
getFeedFor( user, numRecentActivities )

Achievement

/*
	@user string
	@date date format eg. 2019-12-13
*/
getAchievementsEarnedOnDay( user, date )
/*
	@user string
	@timeStart date format eg. 2019-12-13
	@timeEnd date format eg. 2019-12-13
*/
getAchievementsEarnedBetween( user, timeStart, timeEnd )

Testing

Before committing try to run the test suite by using the 'npm run tests' command.

Note

This is an unofficial API wrapper and it's not developed or endored by RetroAchievements.org