Refer to modern Node Packages. Update the Package.json to ONLY need the modern dependencies, reduce packages as much as possible.
A modern TypeScript library for Old School RuneScape (OSRS) data and utilities. Built for developers creating tools, bots, web applications, and analytics around OSRS content.
📦 Type-safe 🚀 Well-tested 📚 Documented 🔄 Actively maintained
Explore the project interactively on CodeSandbox:
- Node.js 16.x or higher
- TypeScript 4.9+
npm install osrs-toolsFor account-related features (hiscores, stats):
npm install osrs-json-hiscoresThe main osrs-tools export provides the most frequently used classes:
import {
QuestTool,
OsrsAccount,
ClueScrollHelper,
Item
} from 'osrs-tools';
// Use core API directly
const questTool = new QuestTool();
const account = OsrsAccount.fromJson({ name: 'Player123' });Import from subpackages for more granular control and better tree-shaking:
// Quest module - access all quests and quest utilities
import { QuestTool, DragonSlayerI } from 'osrs-tools/quest';
// Slayer module - slayer masters and utilities
import { Duradel, SlayerMaster } from 'osrs-tools/slayer';
// Account & skills
import { OsrsAccount, Skill } from 'osrs-tools/account';
// Achievement diaries
import { Ardougne, DiaryName } from 'osrs-tools/diary';
// Tools & utilities
import { ClueScrollHelper, experience } from 'osrs-tools/tools';
import { cache, validation } from 'osrs-tools/utils';// Access a specific quest
import { DragonSlayerI } from 'osrs-tools/quest';
// Or get by name from QuestTool
import { QuestTool } from 'osrs-tools';
const dragonSlayer = QuestTool.getQuestByName('Dragon Slayer');
console.log(dragonSlayer.requirements);
// Check quest completion requirements
const questTool = new QuestTool();
questTool.setOsrsAccount(playerAccount);
const canComplete = questTool.canCompleteQuest(dragonSlayer);import { Duradel } from 'osrs-tools/slayer';
// Get master's task list
const tasks = Duradel.tasks;
// Get random assignment
const task = Duradel.getRandomTask();
console.log(task.name); // e.g., "Abyssal demons"
console.log(task.requirements); // Shows requirementsimport { OsrsAccount } from 'osrs-tools/account';
// Create/load account
const account = OsrsAccount.fromJson({
name: 'Player123',
skills: {
attack: { level: 60 },
strength: { level: 55 },
defence: { level: 50 },
},
});
// Get skill levels
const attackLevel = account.getSkill('attack')?.level;import { yellowPartyhatModelPath } from 'osrs-tools';
console.log(yellowPartyhatModelPath);
// "osrs-tools/models/YellowPartyhat.obj"- Node.js: resolve the shipped asset with
require.resolve(yellowPartyhatModelPath)and read it withfs.readFileSync(...). - Bundlers: import the raw asset directly from
osrs-tools/models/YellowPartyhat.objor use a?urlsuffix if your bundler supports it.
# Clone and setup
git clone https://github.com/jamescer/osrs-tools.git
cd osrs-tools
npm install
# Build and test
npm run build
npm test| Command | Description |
|---|---|
build |
Compile TypeScript to dist/ |
dev |
Watch mode compilation |
test |
Run test suite |
test:watch |
Run tests in watch mode |
test:coverage |
Generate coverage report |
lint |
Lint and fix code |
format |
Format code with Prettier |
source/ # TypeScript source code
├── index.ts # Main entry point
├── runescape/
│ ├── model/
│ │ ├── account/ # Player account & skills
│ │ ├── diaries/ # Achievement diaries
│ │ ├── quest/ # Quest system
│ │ │ ├── all/ # Individual quest classes
│ │ │ └── index.ts # Quest module export
│ │ ├── slayer/ # Slayer system
│ │ ├── Item/ # Item models
│ │ └── npc/ # NPC data
│ ├── tools/ # Utility tools (ClueScrollHelper, experience calc, etc.)
│ ├── utils/ # Helper utilities (cache, validation, etc.)
│ └── errors.ts # Custom error types
└── examples/ # Usage examples
test/ # Jest test suite
└── unit/
├── account/
├── diaries/
├── quest/
├── slayer/
├── model/
├── tools/
└── utils/
dist/ # Compiled output (generated by build)
We welcome contributions! We use Conventional Commits.
-
Fork and clone the repository
-
Create a branch (
feat/amazing-feature) -
Make your changes
-
Run tests (
npm test && npm run lint) -
Commit with conventional format:
feat: add quest requirement validation fix: correct slayer task weights docs: update API documentation
-
Push and open a Pull Request
- Add tests for new features
- Update documentation for changes
- Follow existing code style
- Keep changes focused
Need help or want to contribute?
MIT © James Cerniglia
- Author: James Cerniglia
- Contributors: View all contributors
- Data Source: Old School RuneScape Wiki