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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-cs2

v2.0.1

Published

Modern CS2/CS:GO Game Coordinator integration with latest GameTracking-CS2 protobuf definitions. Includes support for highlight_reel, variations, and all modern CS2 fields.

Readme

node-cs2

npm version Node.js Version

Modern CS2/CS:GO Game Coordinator integration with the latest GameTracking-CS2 protobuf definitions. This package provides a simple API for interacting with the Counter-Strike 2 and CS:GO Game Coordinator, with full support for all modern CS2 features.

What's New in This Fork

This fork addresses critical issues with the original globaloffensive package and adds comprehensive support for modern CS2 features:

Latest GameTracking-CS2 Protobuf Definitions

  • All protobuf files updated from the latest GameTracking-CS2 repository
  • Future-proof with current CS2 game definitions
  • Comprehensive field support for all modern CS2 items

Fixed Missing Fields

  • highlight_reel support in stickers, keychains, and variations
  • musicindex - Music kit support
  • entindex - Entity index support
  • petindex - Pet/companion support
  • style - Style variations support
  • upgrade_level - Item upgrade level support

New Array Support

  • variations - Complete new array for item variations
  • Enhanced stickers array with all new fields
  • Enhanced keychains array with all new fields

Enhanced Handler Logic

  • Updated handlers.js to process all new fields
  • Proper field mapping and null handling
  • 100% backward compatible with existing code

Critical Bug Fixes

Missing highlight_reel Field

Problem: The original package was missing the highlight_reel field in inspect responses, causing incomplete data for items with highlight reels.

Solution: Updated protobuf definitions and enhanced handlers to properly capture and return highlight_reel data.

// Before (missing data)
{
  keychains: [
    {
      slot: 0,
      sticker_id: 36,
      offset_x: 3.445085287094116,
      // highlight_reel: MISSING!
    }
  ]
}

// After (complete data)
{
  keychains: [
    {
      slot: 0,
      sticker_id: 36,
      offset_x: 3.445085287094116,
      highlight_reel: 67890  // NOW WORKING!
    }
  ]
}

Installation

npm install node-cs2

Migration from globaloffensive

This package is 100% API compatible with the original globaloffensive package:

// Old
const GlobalOffensive = require('globaloffensive');

// New - just change the require!
const NodeCS2 = require('node-cs2');

// All your existing code works unchanged!
const cs2 = new NodeCS2(steamUser);

Usage

const SteamUser = require('steam-user');
const NodeCS2 = require('node-cs2');

const user = new SteamUser();
const cs2 = new NodeCS2(user);

user.logOn({
    accountName: 'username',
    password: 'password'
});

user.on('loggedOn', () => {
    console.log('Logged into Steam');
    user.gamesPlayed([730]); // CS2/CS:GO app ID
});

user.on('appLaunched', (appid) => {
    if (appid == 730) {
        console.log('CS2/CS:GO launched');
        cs2.helloGC();
    }
});

cs2.on('connectedToGC', () => {
    console.log('Connected to CS2/CS:GO Game Coordinator');
});

// Inspect an item with full modern field support
cs2.on('inspectItemInfo', (item) => {
    console.log('Item data with all modern fields:', {
        defindex: item.defindex,
        paintindex: item.paintindex,
        paintwear: item.paintwear,
        
        // NEW FIELDS NOW SUPPORTED!
        musicindex: item.musicindex,
        petindex: item.petindex,
        style: item.style,
        upgrade_level: item.upgrade_level,
        
        // ARRAYS WITH FULL FIELD SUPPORT
        stickers: item.stickers, // includes highlight_reel
        keychains: item.keychains, // includes highlight_reel  
        variations: item.variations // NEW! includes highlight_reel
    });
});

// Inspect an item
cs2.inspectItem('76561198057249394', '2569415699', '7115007497');

Inspect URL Support

Full support for both masked and unmasked inspect URLs:

// Unmasked URL (requires Steam client) - NOW WITH FULL FIELD SUPPORT!
const unmaskedUrl = 'steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198857794835A45540551473D7523863830991655521';

// Extract parameters and inspect
const match = unmaskedUrl.match(/S(\d+)A(\d+)D(\d+)/);
if (match) {
    const [, ownerId, assetId, classId] = match;
    cs2.inspectItem(ownerId, assetId, classId);
}

Complete Field Support

Basic Item Fields

  • defindex - Item definition index
  • paintindex - Paint/skin index
  • paintseed - Paint seed
  • paintwear - Wear value
  • rarity - Item rarity
  • quality - Item quality

Modern CS2 Fields

  • musicindex - Music kit index
  • entindex - Entity index
  • petindex - Pet/companion index
  • style - Style variation index
  • upgrade_level - Item upgrade level

Arrays with Full Field Support

  • stickers[] - Sticker applications
  • keychains[] - Keychain attachments
  • variations[] - Item variations (NEW!)

Sticker/Keychain/Variation Fields

  • slot - Attachment slot
  • sticker_id - Sticker/item ID
  • wear - Wear value
  • scale - Scale factor
  • rotation - Rotation angle
  • tint_id - Tint color ID
  • offset_x, offset_y, offset_z - Position offsets
  • pattern - Pattern index
  • highlight_reel - Highlight reel ID (FIXED!)

Development

Building from Source

git clone https://github.com/sak0a/node-cs2.git
cd node-cs2
npm install
npm run generate-protos

Updating Protobuf Definitions

# Copy latest protobuf files from GameTracking-CS2
# Then regenerate:
npm run generate-protos

License

MIT License - see LICENSE file for details.

Credits

Issues & Support

If you encounter any issues or need support:

  1. Check if the issue exists in the original package
  2. Open an issue on GitHub
  3. Provide detailed information about your use case

Why Use This Fork?

  • Up-to-date with latest CS2 definitions
  • Bug fixes for missing fields
  • Enhanced functionality with new CS2 features
  • 100% compatible with existing code
  • Actively maintained with GameTracking-CS2 updates
  • Community-driven improvements