JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q36654F
  • License MIT

A wrapper library to call the Steamworks API from nodeJS.

Package Exports

  • @theace0296/steamworks
  • @theace0296/steamworks/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@theace0296/steamworks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm GitHub release (latest by date)

@theace0296/steamworks

A wrapper library to call the Steamworks API from nodeJS.

Requirements

This package uses CMake.js, and therefore requires CMake to install.

Installation

npm install @theace0296/steamworks

After installing, run the initialization script:

npx steamworks-init

This step will authenticate and download the Steamworks SDK, if you already have the Steamworks SDK on your computer, you can set the STEAMWORKS_SDK_PATH environment variable to the location of the Steamworks SDK.

Docs

Basic Usage

const steamworks = require('@theace0296/steamworks');
// The constructor of steamworks's default export calls the Steam API Init function.
const SteamWorks = new steamworks(/* Optional app_id */);
const {
  SteamAPI,
  Constants,
  Enums,
  Structs,
  Uncategorized,
  // Steam API Interfaces are also available at this level see index.d.ts
} = SteamWorks;

(async () => {
  if (SteamAPI.IsSteamRunning()) {
    console.log('Steamworks API Initialized!');

    const remoteStorageSubscribedFilesResult = await SteamWorks.SteamRemoteStorage.EnumerateUserSubscribedFiles(0);
    console.log(`Published files result:\n${JSON.stringify(remoteStorageSubscribedFilesResult)}`);

    const numSubscribedFiles = SteamWorks.SteamUGC.GetNumSubscribedItems();
    const [subscribedFilesResult, subscribedFiles] =
      SteamWorks.SteamUGC.GetSubscribedItems(numSubscribedFiles);
    console.log(`Subscribed files result:\n${subscribedFilesResult}`);
    console.log(`Number of Subscribed files:\n${numSubscribedFiles}`);
    console.log(`Subscribed files:\n${JSON.stringify(subscribedFiles)}`);

    SteamWorks.Shutdown();
  }
  console.error('Steamworks API failed to Initialize!');
})();