JSPM

cs2-inventory-resolver

0.2.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 23
    • Score
      100M100P100Q71009F

    Resolve CS2 Game Coordinator protobuf items into human-readable names, images, and categories

    Package Exports

    • cs2-inventory-resolver

    Readme

    cs2-inventory-resolver

    Resolve raw CS2 Game Coordinator (GC) items into human-readable names, images, and categories.

    Installation

    The package is not yet published to npm. Install directly from GitHub:

    npm install cs2-inventory-resolver

    Usage

    resolveItem(gcItem)

    Takes a raw GC item and returns its name, image URL, and category.

    import { resolveItem } from 'cs2-inventory-resolver';
    
    const result = resolveItem({ def_index: 7, paint_index: 282 });
    // => { name: "AK-47 | Redline", image: "https://...", category: "skin" }

    Returns null if the item could not be identified.

    getAttributeUint32(item, attrDefIndex)

    Reads a uint32 value from a GC item's raw attribute[] array.

    import { getAttributeUint32 } from 'cs2-inventory-resolver';
    
    const musicIndex = getAttributeUint32(gcItem, 166);
    if (musicIndex) {
      console.log('Music kit ID:', musicIndex);
    }