/osu-db-parser

A node.js wrapper for osu!.db and collection.db

Primary LanguageJavaScriptMIT LicenseMIT

osu-db-parser

npm version install size npm downloads license: MIT

That package can read files from osu folder called osu!.db and collection.db About struct that db look on peppy site: link

Installing

Using npm:

$ npm install osu-db-parser

Example (how to read osu!.db)

const fs = require("fs");
const OsuDBParser = require("osu-db-parser");

let osuDBbuffer = Buffer.from(fs.readFileSync("<PATH-TO OSU-DB>"));
const osuDB = new OsuDBParser(osuDBbuffer);

let osuDBData = osuDB.getOsuDBData(); // This is osu!.db data you can make with this all that you want.

You can update buffer on fly

let newBuffer = Buffer.from(fs.readFileSync("<PATH-TO OSU-DB>"));
osuDB.setBuffer("osudb", newBuffer);

let newData = osuDB.getOsuDBData();

Example (how to read collection.db)

Similar to how to read osu!.db ;D

const fs = require("fs");
const OsuDBParser = require("osu-db-parser");

let collectionBuffer = Buffer.from(fs.readFileSync("<PATH-TO COLLECTION-DB>"));
const collectionDB = new OsuDBParser(null, collectionBuffer); // Yeah, that's okay

let osuCollectionData = collectionDB.getCollectionData() // This is collection.db data you can make with this all that you want.

And too. You can update buffer on fly

let newBuffer = Buffer.from(fs.readFileSync("<PATH-TO OSU-DB>"));
collectionDB.setBuffer("collection", newBuffer);

let newData = collectionDB.getCollectionData() ;

Or you can use two solution in one

const fs = require("fs");
const OsuDBParser = require("osu-db-parser");

let osuDBbuffer = Buffer.from(fs.readFileSync("<PATH-TO OSU-DB>"));
let collectionBuffer = Buffer.from(fs.readFileSync("<PATH-TO COLLECTION-DB>"));
const ultimateDB = new OsuDBParser(osuDBbuffer=osuDBbuffer, osuCollectionBuffer=collectionBuffer);

let osuDBData = ultimateDB.getOsuDBData();
let osuCollectionData = ultimateDB.getCollectionData();

If something wrong, pleas-s-s-s-e create PR with fix)