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

osureplayparser

v1.0.1

Published

An osu! + osu!mania replay parser written in Node.js

Downloads

19

Readme

osu! Replay Parser

The ultimate osu! replay (.osr) parsing package that supports both osu! standard and osu!mania. It parses each replay frame in a clearly formatted object.

Installation

  • Install the package from npm npm install osureplayparser --save

Usage

  • It's best if you take a look at the example in the tests
const osuReplayParser = require('osureplayparser');

const replayPath = "./path/to/your/replay.osr";
const replay = osuReplayParser.parseReplay(replayPath);

console.log(replay);

Documentation

The replay object returned is very simple, however it differentiates for both osu! and mania.

Base Replay Data

Here is the base data of what you'll get with every replay. You have all data that was parsed from the original package: node-osr plus some added stuff.

{
  "gameMode": 3,
  "gameVersion": 20150414,
  "beatmapMD5": "c486f38146e0a14057ed1e3d3908c0c8",
  "playerName": "Swan",
  "replayMD5": "aed34df46c7c4a0f955edca59ca52fe1",
  "number_300s": 1384,
  "number_100s": 11,
  "number_50s": 6,
  "gekis": 1417,
  "katus": 89,
  "misses": 9,
  "score": 906808,
  "max_combo": 1161,
  "perfect_combo": 0,
  "mods": 0,
  "life_bar": "",
  "timestamp": "0001-01-01T00:00:00.000Z",
  "replay_length": 13625,
  "replay_data": [],
  "raw_replay_data": "0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0,0|256|1|0...."

Replay Data

The replay data object for mania and the other game modes are different. It should be self-explanatory and easy to read.

osu! Standard Replay Data Example

"replay_data": [
  {
    "timeSinceLastAction": 11,
    "x": 108.4803,
    "y": 187.5656,
    "keyPressedBitwise": 10,
    "keysPressed": {
      "K1": false,
      "K2": true,
      "M1": false,
      "M2": false
    }
  },
]

osu!mania Replay Data Example

As you can see, you get the exact keys pressed for keys 1-10. This works on every key mode. Regardless of whether or not the mode has more keys, you'll still receive 10 in the object, however they will always be false.

"replay_data": [
  {
    "timeSinceLastAction": 2,
    "x": 13,
    "y": 18.88889,
    "keyPressedBitwise": 0,
    "keysPressed": {
      "Key1": true,
      "Key2": false,
      "Key3": true,
      "Key4": true,
      "Key5": false,
      "Key6": false,
      "Key7": false,
      "Key8": false,
      "Key9": false,
      "Key10": false
    }
  },
]

Credits

The base of this replay parser was originally written by vignedev. Here is the original called node-osr. I have only expanded upon it and further parsed the replay data, so most of the credit goes to him.

LICENSE

All the code in this repository is licensed under MIT