Coder Social home page Coder Social logo

vignedev / node-osr Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 34 KB

NodeJS library for serialization and deserialization of osu replay files

Home Page: https://www.npmjs.com/package/node-osr

License: MIT License

JavaScript 100.00%
osugame osu-libraries

node-osr's Introduction

node-osr

NodeJS library for reading and writing osu replay files


Features

  • Load .osr replays
  • Create new Replays
  • Write them in .osr
  • Synchronous and asynchronous
  • Promise asynchronous functions

Install

Download it from npm.

$ npm install node-osr --save

Documentation

Check out the examples

Require node-osr let osr = require('node-osr')

osr.read([string | Buffer])

Promise version of osr.read().

osr.read([string | Buffer], (err, replay))

Asynchronious version of osr.readSync().

osr.readSync([string | Buffer])

Returns a Replay class with the input's data.

new osr.Replay()

Creates a new blank Replay class.

Replay {
  gameMode: 0,
  gameVersion: 0,
  beatmapMD5: '',
  playerName: '',
  replayMD5: '',
  number_300s: 0,
  number_100s: 0,
  number_50s: 0,
  gekis: 0,
  katus: 0,
  misses: 0,
  score: 0,
  max_combo: 0,
  perfect_combo: 0,
  mods: 0,
  life_bar: '',
  timestamp: 0,
  replay_length: 0,
  replay_data: '',
  unknown: 0
}

replay.serialize()

Promise version of replay.serialize().

replay.write(path(err, Buffer))

Asynchronous version of replay.writeSync()

replay.writeSync(path)

Writes replay into a file specified by path

replay.serialize((err, Buffer))

Asynchronous version of replay.serializeSync().

replay.serializeSync()

Returns the Buffer of the replay.

Related libraries

osureplayparser - Clearly formatted replay reading based on this library

License

MIT

node-osr's People

Contributors

vignedev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

yhsphd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.