
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A comprehensive Node.js library for osu! development, providing tools for API integration, PP calculation, beatmap parsing, and various osu!-related utilities.
npm install osu-utils
const { osuUtils, ApiV1 } = require('osu-utils');
// API Client
const api = new ApiV1('your-api-key');
const user = await api.getUser('Puparia');
// PP Calculation
const fs = require('fs');
const beatmapContent = fs.readFileSync('beatmap.osu', 'utf8');
const result = osuUtils.CalculatePP(beatmapContent, { combo: 200, misses: 0 });
console.log(`Star Rating: ${result.difficulty.stars}`);
console.log(`PP: ${result.performance.pp}`);
Complete interface for osu! API v1 with automatic data formatting and multi-mode support.
const { ApiV1 } = require('osu-utils');
const api = new ApiV1('your-api-key');
const user = await api.getUser('Puparia');
const bestScores = await api.getUserBest('Puparia', 0, 5);
Features: Auto-detection, structured responses, all game modes, error handling, retry logic, caching
Documentation: Data Formats • Examples • Error Handling
Run the comprehensive test suite:
npm test
Run API-specific tests:
npm run test:api
osu-utils includes advanced PP and difficulty calculation capabilities!
This integration uses rosu-pp-js by @MaxOhn - a high-performance JavaScript binding to the Rust library rosu-pp through WebAssembly. This provides:
CalculatePP() - Complete difficulty + performance calculationCalculateDifficulty() - Difficulty calculation onlyGetStrains() - Strain data for difficulty visualizationConvertBeatmap() - Convert beatmaps between game modesGetBeatmapInfo() - Extract comprehensive beatmap metadataSpecial thanks to @MaxOhn for creating the amazing rosu-pp-js library!
const { ApiV1 } = require('osu-utils');
const api = new ApiV1('your-api-key');
// Get user information
const user = await api.getUser('Puparia');
console.log(`${user.username} is level ${user.stats.level}`);
// Get best scores with beatmap info
const bestScores = await api.getUserBest('Puparia', 0, 5, true);
bestScores.forEach(score => {
console.log(`${score.beatmap.metadata.artist} - ${score.beatmap.metadata.title}`);
console.log(`Score: ${score.score.toLocaleString()} - ${score.performance.accuracy}%`);
});
// Multi-mode support
const modes = [
{ name: 'osu!', id: 0 },
{ name: 'Taiko', id: 1 },
{ name: 'CTB', id: 2 },
{ name: 'Mania', id: 3 }
];
for (const mode of modes) {
const user = await api.getUser('Puparia', mode.id);
console.log(`${mode.name}: ${user.stats.pp} PP (#${user.stats.ppRank})`);
}
const { osuUtils } = require('osu-utils');
const fs = require('fs');
// Read beatmap content
const beatmapContent = fs.readFileSync('beatmap.osu', 'utf8');
// Calculate PP for perfect score
const result = osuUtils.CalculatePP(beatmapContent, {
combo: 200,
misses: 0,
mods: 0
});
console.log(`Star Rating: ${result.difficulty.stars}`);
console.log(`PP: ${result.performance.pp}`);
// Calculate PP with mods
const hrResult = osuUtils.CalculatePP(beatmapContent, {
combo: 200,
misses: 0,
mods: 16 // Hard Rock
});
console.log(`PP with HR: ${hrResult.performance.pp}`);
// Calculate difficulty only (faster)
const difficulty = osuUtils.CalculateDifficulty(beatmapContent, {
mods: 64 // Double Time
});
console.log(`Star Rating with DT: ${difficulty.stars}`);
const { osuUtils } = require('osu-utils');
// Calculate accuracy
const accuracy = osuUtils.CalcAccuracy(0, 100, 50, 25, 5); // osu! mode
console.log(`Accuracy: ${accuracy}%`);
// Format time
const formatted = osuUtils.FormatMs(125000);
console.log(formatted); // "2:05.000"
// Convert mods
const bitmask = osuUtils.ModsStringToInt('HDHRDT');
console.log(bitmask); // 88
const modsString = osuUtils.ModsIntToString(88);
console.log(modsString); // "HDHRDT"
// Check mods
const hasHidden = osuUtils.HasMod(88, 'HD');
console.log(hasHidden); // true
try {
const user = await api.getUser('Puparia');
if (user === null) {
console.log('User not found');
} else {
console.log('User found:', user.username);
}
} catch (error) {
console.error('API Error:', error.message);
}
The library includes a comprehensive test suite covering all functionality:
# Run all tests
npm test
# Run API-specific tests
npm run test:api
Test Coverage:
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions, issues, or feature requests, please open an issue on GitHub.
Made with ❤️ for the osu! community
FAQs
Basics Utils for osu projects
We found that osu-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.