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

csgodirect

v0.1.6

Published

Command line interface and library module for csgodirect

Readme

#CSGO Direct Client API Send commands through the command line, or include it in your node app to easily connect to CSGO Direct. Requires a registered user account which you can get at www.csgodirect.com.

#Installing npm install -g csgodirect to install system wide.

#Command Line Usage If installed globally, use as a command line tool to query the CSGO Direct API server.

##Help Type csgodirect in your command line to access help documentation

  csgodirect

You can also list all available commands:

  csgodirect -h

##Login If you have an API key already, you can skip login, otherwise login to retreive a new key.

  csgodirect login --login [email protected] --password yourpassword 

This returns to you a token string, store it for future requests.

8bc17f11-d594-4a06-89c2-03d42c75cd10

##Logout Logout invalidates your token.

  csgodirect logout -t 8bc17f11-d594-4a06-89c2-03d42c75cd10

Returns true

##Commands (Actions) CSGO Direct calls the api calls "actions", each action from the CLI follows the same pattern:

csgodirect -t 8bc17f11-d594-4a06-89c2-03d42c75cd10 actionName --parameter parameter

The -t allows you to specify your login token. The action name is the action you want to execute followed by named parameters in the form --param1 param1 --param2 param2

#Module Usage The underlying api calls use request-promise, so calls will return a promise.

Include the library in your project:

  var Direct = require('csgodirect')

  //default options
  //optionally set the csgodirect host url
  var csgoDirectHost = 'https://api.csgodirect.com'
  //optionally set your user token, or use login to set it
  var token = null
  //optionally set api version number
  var version = 'v1'

  var direct = Direct(csgoDirectHost,token,version)


  //login to your user, get a token
  direct.login({ login:'myusername',password:'mypassword' }).then(function(token){
    //the client will store your token internally on successful login
    //but you can also store it yourself
  })

  //calling an action
  var parameters = {
    param1:param1
  }

  //token is optional after you've logged in because the client will store it
  direct.action('someAction',params,optionalToken).then(function(result){
    console.log(result)
  })

#Module API ##Construction Initialize a client instance

  var Direct = require('csgodirect')
  direct = Direct(host,token,version)

###Parameters

  • host(optional)(default: https://api.csgodirect.com) - specify host url if you are not using the default url
  • token(optional)(default: null) - store your user api token for future commands
  • version(optional)(default: 'v1') - specify version of actions to use.

###Returns A csgodirect client object used to interact with the API

##Login Get your token, cache it in the client for future commands

  direct.login({
    login:'your login name',
    password:'your password',
  }).then(function(token){
    //returns a token string
  })

###Parameters

  • login(required) - your csgodirect login
  • password(required) - your password

###Returns A promise which returns a string representing your user token.

##Signup Create a new user.

  direct.signup({
    login:'your login name',
    password:'your password',
  }).then(function(user){
    //returns the new user
  })

###Parameters

  • login(required) - your csgodirect login
  • password(required) - your password

###Returns A promise which returns a user object

##Logout Logout and invalidate your token. Also clears your token cache.

  direct.logout().then(function(){
    //returns on successful logout
  })

###Returns A promise which resolves on successful logout

##Actions This is a majority of your interactions with CSGO Direct. Use this function to call all actions. All actions are defined in camel case and take in a parameter object.

  direct.action('actionName',{parameter1:'parameter1'},'optionalToken').then(function(result){
    //returns action result
  }).catch(function(err){
    //or error if something went wrong
  })

###Parameters

  • actionName(required) - Name of action you are calling
  • params(sometimes optional) - Not all actions require parameters, but you specify them as a single object with parameters named as key value pairs
  • token(optional) - Optionally use a token on this call, will override the cached token, or use cachhed token if not defined

###Returns A promise with the result of the action. See documentation on action specifics.

##Help Return a list of actions, or get JSON documentation on a specific action

  direct.help().then(function(actions){
    //returns list of possible actions
  })

  direct.help('getMyUser').then(function(doc){
    //returns json object representing documentation on that action
  })

###Parameters

  • action(optional)(default: null) - Specify action to get more detailed documentation on usage

###Returns A promise which resolves a list of actions, or an object with documentation on specific action.

##Set Token Manually set a token to use for all future calls to the client

  //just echoes back the token, but stores it in memory for future calls
  var token = direct.setToken('my token string')

###Parameters

  • token(optional)(default: null) - The token to save for future calls. NULL will clear the token.

###Returns Returns whatever you pass into it.