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

csgostatsnode

v1.1.1

Published

A nodeJS lib to provide CSGO Player stats.

Downloads

8

Readme

npm version Downloads GitHub issues

CSGO NodeJS wrapper

A nodeJS lib to provide CSGO Player stats.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

Run the following command in npm

npm install --save csgostatsnode

Example/Deployment

Require in the module as follows

const csgoStats = require('csgoStatsNode');
const cStats = new csgoStats({"apikey":"<Put your Steam API key here >"});

Here is an example of getting a players K/D

csStats.whatIsMyKD('76561198138999275', function(data){
  console.log("Your K/D is: " + data);
})

Here is another example of getting a players Steam ID from their vanity URL

csStats.getMySteamID('xserv', function(data){
  console.log("Your Steam ID is: " + data);
});

Options

when creating a new instance of the class eg:

const cStat = new csgoStats();

You must pass through your Steam API key

  • apikey - This is the key you will get for signing up for a to the Steam API (Its free to get it)

You can obtain one at https://steamcommunity.com/dev

you can pass through options such as:

  • quiet - This will suppress any console.log() messages that the class makes. This can be set to 1 to suppress the messages.
  • vanity - This allows just vanity URL's to be used instead of Steam ID's. To use this set vanity to true.

to set the options all you have to do is put a JSON object when creating the class instance

const cStat = new csgoStats({"quiet":"1", "vanity":"true", "apikey":"<Put your Steam API key here >"});

Available Commands

All of these functions take the Steam ID or Vanity URL if the option is set with the exception of getMySteamID which only takes a Vanity URL

  • getStats - This by its-self will return all CS:GO related data eg: Kills with each weapon, MVP medals and Achievements.
  • getProfile - Gets all data relating to a players profile eg: Profile name, Profile Image, Last Logon Time, Game ID (If the player is playing a game).
  • getProfilePic - Uses the Data from getProfile and pulls your full size (184x184) profile image URL.
  • whatIsMyKD - Basic function that calculates your CS:GO K/D to 2 dp (decimal Point).
  • getMySteamID - Using a players vanity URL this functions will return the Steam ID.
  • getMyBans - Get all bans from Steam eg: VAC Bans, Community Bans and Economy Bans.
  • isVac - A simple function that takes the data from getMyBans and checks if the VACBanned key is true or false.

Built With

  • Needle - A HTTP client for NodeJS

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details