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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pendo324/steam-resources

v1.1.0

Published

Steam resources for Node.js

Downloads

4

Readme

node-steam-resources

This is a node wrapper around Steam resources (Protobufs and SteamLanguage) from SteamKit. It's primarily intended for node-steam extension module authors.

Installation

  1. npm install git://github.com/seishun/node-steam-resources.git
  2. Run npm install in the steam-resources directory to run the prepublish script (see npm/npm#3055). It pulls the Steam resources from SteamKit and requires svn.
  3. If you're going to publish your module, add steam-resources to bundledDependencies in your package.json, since you want to publish with the resources bundled. Note that npm publish will bundle the dependencies of steam-resources as well. You could delete steam-resources/node_modules manually before publishing, but npm <3 doesn't install dependencies of bundled dependencies automatically.

If you ever need to update the resources, just run npm install in the steam-resources directory again.

Usage

var Steam = require('steam-resources');

Steam is now a namespace object containing enums and classes generated from the protobufs and SteamLanguage.

Enums

For each enum in SteamLanguage, there is an equivalently named property on Steam. The property is an object; for each of the enum's members, there is an equivalently named property on the object with an equivalent Number value.

For example, Steam.EClanPermission.OwnerOfficerModerator is equal to 11.

Protobufs

For each protobuf message or enum available in SteamKit2, there is an equivalently named class or enum generated using ProtoBuf.js version ^4.1. They lie in the same hierarchy as in SteamKit2, with objects for namespaces. (If you see a mismatch, consider that a bug.)

For example, the CMsgGCTopCustomGamesList message from dota_gcmessages_common.proto is available as SteamKit2.GC.Dota.Internal.CMsgGCTopCustomGamesList in SteamKit2 and as Steam.GC.Dota.Internal.CMsgGCTopCustomGamesList here.

Structs

For each class in SteamLanguage, there is an equivalently named class in Steam.Internal. They are intended to implement a subset of the API provided by ProtoBuf.js message classes. Namely, for a class MsgGabe:

  • An MsgGabe instance has an equivalently named property for each non-const member of MsgGabe with the type as follows (modifiers like boolmarshal are ignored):
    • byte<> members: ByteBuffer.js ^5.0 objects
    • long and ulong members: ByteBuffer.Long objects
    • Other numeric members: Number
    • Protobuf message members: message class instances
  • For each const member of MsgGabe, there is an equivalently named property on the MsgGabe class with an equivalent value.
  • MsgGabe.decode(buf) returns an MsgGabe instance deserialized from buf. buf can be either a Buffer or a ByteBuffer.js ^5.0 instance. In the latter case, it decodes starting from buf.offset and increments it by message size.
  • new MsgGabe(obj) creates an MsgGabe instance from an object. new MsgGabe() is equivalent to new MsgGabe({}). For each non-const member of MsgGabe, if there is an equivalently named property in obj, it sets the instance property to the (possibly converted) value of the property in obj, otherwise to the default value. In addition to the types listed above, obj properties can have the following types:
    • byte<> members: Buffer objects (converted using ByteBuffer.wrap)
    • Numeric members: String or Number (converted using Long.fromValue)
    • Protobuf message members: objects (converted using the message class constructor)
  • An MsgGabe instance gabe has the following methods:
    • gabe.encode() serializes the MsgGabe instance and returns a ByteBuffer.js ^5.0 object.
    • gabe.toBuffer() returns this.encode().toBuffer().

For example, MsgClientChatRoomInfo can be used as follows:

var chatRoomInfo = new Steam.Internal.MsgClientChatRoomInfo({
  steamIdChat: '103582791432594962'
});
var buf = chatRoomInfo.toBuffer();
var chatRoomInfo2 = Steam.Internal.MsgClientChatRoomInfo.decode(buf);