npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cs2-inventory-resolver

v0.3.4

Published

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

Readme

cs2-inventory-resolver

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

Installation

npm install cs2-inventory-resolver

Usage

resolveItem(gcItem)

Takes a raw GC item and returns its name, image URL, entity type, rarity, and marketability.

For skins, the name is fully decorated with the appropriate prefix and wear:

  • StatTrak™ prefix (detected via attribute 80)
  • Souvenir prefix (detected via attribute 140)
  • for knives/gloves (already included in the base name)
  • Wear suffix based on paint_wear (e.g. Factory New, Field-Tested)
import { resolveItem } from 'cs2-inventory-resolver';

// Regular skin
resolveItem({ def_index: 7, paint_index: 282, paint_wear: 0.30 });
// => { name: "AK-47 | Redline (Field-Tested)", image: "https://...", entity: "skin", rarity: { id: "rarity_mythical_weapon", name: "Restricted", color: "#8847ff" }, marketable: true }

// StatTrak skin
resolveItem({ def_index: 7, paint_index: 282, paint_wear: 0.30, attribute: [{ def_index: 80, value_bytes: ... }] });
// => { name: "StatTrak™ AK-47 | Redline (Field-Tested)", ... }

// StatTrak knife (quality 3 = ★ already in name)
resolveItem({ def_index: 507, paint_index: 38, quality: 3, paint_wear: 0.01, attribute: [{ def_index: 80, value_bytes: ... }] });
// => { name: "★ StatTrak™ Karambit | Fade (Factory New)", ... }

// Non-skin item
resolveItem({ def_index: 1505 });
// => { name: "CS:GO Case Key", image: "https://...", entity: "key", rarity: null, marketable: true }

Returns null if the item could not be identified.

Input (GcItemInput)

| Field | Type | Description | |-------|------|-------------| | def_index | number | Item definition index (required) | | paint_index | number? | Paint/skin index | | quality | number? | Item quality (3 = ★ knife/glove) | | paint_wear | number? | Wear float (0.01.0) | | stickers | {sticker_id?: number}[]? | Sticker slots | | attribute | {def_index: number; value_bytes?: Buffer}[]? | Raw attribute array |

Output (ResolvedItemData)

| Field | Type | Description | |-------|------|-------------| | name | string | Decorated item name | | image | string | Image URL | | entity | ItemEntity | Item type (skin, crate, key, collectible, etc.) | | rarity | {id, name, color} \| null | Rarity info or null | | marketable | boolean | Whether the item is marketable on Steam |

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);
}