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

aof-file-parser

v0.0.4

Published

A module to read and write .aof files. The aof file format is used by the website aof.gg (AnalyzeOrFeed) to store League of Legends replays and some additional metadata.

Downloads

13

Readme

#aof-file-parser

A module to read and write .aof files. The aof file format is used by the website aof.gg (AnalyzeOrFeed) to store League of Legends replays and some additional metadata.

Install

npm install --save https://github.com/AnalyzeOrFeed/aof-file-parser

Example


let aofParser = require('aof-file-parser');

let game = {
    // insert game data here
};

// to write a file
aofParser.save(game, 'replay-euw-123', (result) => {
    if (!result.success) {
        console.log(result.error); // Error, file has not been saved
    } else {
        // File has been saved!
        console.log(result.warnings); // If there were warnings, print them
    }
});

// read a file
aofParser.load('replay-euw-123.aof', (result, replayMetadata, replayData) => {
    if (!result.success) {
        console.log(result.error);
    } else {
        // Replay has been loaded
    }
});

Usage

.save(game, filename, callback)

game: game

Contains all the necessary information about the game.

filename: string

The location of the aof file (without .aof ending).

callback: (result: {success: boolean, error: string, warnings: Array}) => any

The callback that will be called in case of an error or when the file has been saved successfully.

  • If success is false, result.error will contain the error message
  • If success is true, result.warnings can contain warnings, but the file will still have been saved

.load(file, callback)

file: string

Location of the .aof file.

callback: (result: {success: boolean, error: string}, replayMetadata: replayMetadata, replayData: replayData) => any

The callback that will be called in case of an error or when the file has been parsed successfully.

Objects

game

var game = {
    regionId: number; // Region id: Can be obtained using our API: https://api.aof.gg/v2/data/static
    gameId: number;
    riotVersion: string; // Version of the current patch. For example: 6.9.1 Can be obtained using our API: https://api.aof.gg/v2/data/static
    key: string; // Encryption key provided by the Riot API
    endStartupChunkId: number;
    startGameChunkId: number;
    players: Array<Players>;
    keyframes: Array<Keyframes>;
    chunks: Array<Chunks>;
}

players

var players = {
    id: number; // Summoner ID
    summonerName: string;
    teamNr: number; // 0 for blue or 1 red team
    leagueId: number;
    leagueRank: number;
    championId: number;
    dId: number; // ID of the summoner spell on d
    fId: number; // ID of the summoner spell on f
}

replayMetadata

var replayMetadata = {
    version: number; // Version of the .aof file format
    regionId: number;
    gameId: number;
    riotVersion: string;
    key: string;
    endStartupChunkId: number;
    startGameChunkId: number;
    players: Array<Players>;
}

replayData

var replayData = {
    keyframes: [{
        id: number; // Keyframe ID
        data: binary; // Keyframe data
    }],
    chunks: [{
        id: number; // Chunk ID
        data: binary; // Chunk data
    }]
}