Skip to content

TF2-Price-DB/pricedb-io-tf2

Repository files navigation

@pricedb-io TF2 Trading Utilities

A comprehensive collection of Node.js packages for Team Fortress 2 trading bots and applications. This monorepo contains modular, reusable utilities for TF2 item management, pricing, and bot operations.

πŸ“¦ Packages

TF2 unusual effects database and utilities with 150+ effects mapping.

npm install @pricedb-io/tf2-effects

Features:

  • Complete unusual effects database
  • Effect name/ID mapping and search
  • Generation-based categorization
  • Zero dependencies

Halloween spell system for TF2 items with comprehensive attribute mapping.

npm install @pricedb-io/tf2-spells

Features:

  • Complete Halloween spells database
  • Attribute ID to spell mapping
  • SKU suffix generation for spells
  • Spell decoding from item attributes

Auto-discovery and management of tf2autobot installations.

npm install @pricedb-io/tf2-bot-discovery

Features:

  • Smart tf2autobot installation detection via package management
  • Automatic bot configuration discovery and validation
  • PM2 and process-based detection
  • Multiple installation support with enhanced search methods

Backpack.tf price fetching with Steam Community Market integration.

npm install @pricedb-io/tf2-price-fetcher

Features:

  • Backpack.tf API integration
  • Key price management and conversion
  • Currency normalization (metal/keys/USD)
  • Automatic rate limiting and caching

Steam Community Market integration with advanced price calculation.

npm install @pricedb-io/tf2-market

Features:

  • Steam Community Market API
  • SKU to market hash name conversion
  • Price calculation and profit analysis
  • Market availability checking

Enhanced TF2 schema management with comprehensive SKU utilities.

npm install @pricedb-io/tf2-schema

Features:

  • Robust schema fetching and caching
  • Complete SKU parsing and validation
  • Display name generation
  • Spell integration support

πŸš€ Quick Start

Basic Usage

// Initialize schema with Steam API key
const { initializeSchema } = require('@pricedb-io/tf2-schema');
const schemaManager = await initializeSchema({
  apiKey: 'your-steam-api-key',
});

// Parse TF2 item SKUs
const { parseSKU } = require('@pricedb-io/tf2-schema');
const item = parseSKU('5021;6;uncraftable');
console.log(item); // { defindex: 5021, quality: 6, craftable: false, ... }

// Get unusual effects
const { TF2Effects } = require('@pricedb-io/tf2-effects');
const effects = new TF2Effects();
const effect = effects.getEffectName(13);
console.log(effect); // "Miami Nights"

// Fetch prices from backpack.tf
const { BackpackPriceFetcher } = require('@pricedb-io/tf2-price-fetcher');
const priceFetcher = new BackpackPriceFetcher();
const prices = await priceFetcher.fetchPrices(['5021;6']);

Advanced Integration

const { TF2BotDiscovery } = require('@pricedb-io/tf2-bot-discovery');
const { SteamMarketFetcher } = require('@pricedb-io/tf2-market');
const { TF2Spells } = require('@pricedb-io/tf2-spells');

// Discover bot installations
const discovery = new TF2BotDiscovery();
const bots = await discovery.findTf2AutobotInstallations();

// Check Steam Community Market
const market = new SteamMarketFetcher();
const marketData = await market.fetchPriceOverview('Mann Co. Supply Crate Key');

// Handle Halloween spells
const spells = new TF2Spells();
const spell = spells.getSpellByAttribute(1004);
console.log(spell.name); // "Headless Horseshoes"

πŸ“‹ Requirements

  • Node.js: >= 14.0.0
  • Dependencies: Individual packages have minimal dependencies
  • Steam API Key: Required for schema fetching (some packages)
  • PM2: Optional, for bot discovery features

πŸ› οΈ Development

Setup

# Clone the repository
git clone https://github.com/TF2-Price-DB/pricedb-io-tf2.git
cd pricedb-io-tf2

# Install dependencies for all packages
npm run install-all

# Run tests
npm test

# Run linting
npm run lint

Package Structure

Each package follows a consistent structure:

packages/package-name/
β”œβ”€β”€ index.js          # Main entry point
β”œβ”€β”€ lib/              # Core functionality
β”‚   β”œβ”€β”€ class1.js
β”‚   └── class2.js
β”œβ”€β”€ package.json      # Package configuration
β”œβ”€β”€ README.md         # Package documentation
└── test/            # Test files (when applicable)

Building and Publishing

# Build all packages
npm run build

# Publish all packages (requires npm access)
npm run publish-all

# Publish specific package
cd packages/tf2-effects
npm publish --access public

πŸ§ͺ Testing

# Run all tests
npm test

# Test specific package
npm run test:tf2-effects

# Watch mode for development
npm run test:watch

πŸ“– Documentation

Each package includes comprehensive documentation:

  • README.md: Usage examples and API reference
  • JSDoc Comments: Inline code documentation
  • Type Definitions: TypeScript-style JSDoc annotations

SKU Format Documentation

TF2 SKUs (Stock Keeping Units) follow this format:

defindex;quality[;attribute1;attribute2;...]

Examples:

  • 5021;6 - Unique Mann Co. Supply Crate Key
  • 266;5;u10 - Unusual Fancy Fedora with Miami Nights effect
  • 200;11;sp-1004;sp-1005 - Strange Bottle with Halloween spells

See individual package documentation for detailed format specifications.

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Guidelines

  1. Code Style: Follow ESLint configuration
  2. Testing: Add tests for new features
  3. Documentation: Update README and JSDoc comments
  4. Dependencies: Keep minimal, avoid bloat
  5. Backward Compatibility: Maintain semver compatibility

Package Development

When creating new packages:

  1. Follow the established structure pattern
  2. Include comprehensive README documentation
  3. Add appropriate peer dependencies
  4. Implement proper error handling
  5. Include usage examples

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ› Support

πŸ”— Related Projects

πŸ“ˆ Roadmap

  • TypeScript definitions
  • Browser compatibility versions
  • GraphQL API integration
  • Real-time price streaming
  • Advanced analytics utilities
  • Performance optimizations
  • Mobile SDK versions

🏷️ Version History

Latest Releases

  • tf2-effects: v1.0.0 - Initial release with 150+ effects
  • tf2-spells: v1.0.0 - Complete Halloween spell system
  • tf2-bot-discovery: v1.0.0 - Bot installation discovery
  • tf2-price-fetcher: v1.0.0 - Backpack.tf integration
  • tf2-market: v1.0.0 - Steam market integration
  • tf2-schema: v1.0.0 - Schema management and SKU utilities

See individual package changelogs for detailed version history.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published