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-resolverUsage
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);
}Common attribute def_indexes:
| def_index | Attribute |
|---|---|
| 166 | music_index |
| 233 | graffiti_tint |
| 299 | keychain_index |
Types
The package also exports the following types:
**GcItemInput**- The input shape accepted byresolveItem()**ResolvedItemData**- The object returned byresolveItem()**ItemCategory**-'skin' | 'music_kit' | 'keychain' | 'graffiti' | 'crate' | 'collectible' | 'sticker'