Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vignedev/node-osr
NodeJS library for serialization and deserialization of osu replay files
https://github.com/vignedev/node-osr
osu-libraries osugame
Last synced: 13 days ago
JSON representation
NodeJS library for serialization and deserialization of osu replay files
- Host: GitHub
- URL: https://github.com/vignedev/node-osr
- Owner: vignedev
- License: mit
- Created: 2017-06-17T13:04:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-06T16:39:41.000Z (about 7 years ago)
- Last Synced: 2024-12-15T04:24:17.520Z (about 1 month ago)
- Topics: osu-libraries, osugame
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-osr
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](./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](https://github.com/Swan/osuReplayParser) - Clearly formatted replay reading based on this library## License
MIT