Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 3.28 KB

File metadata and controls

63 lines (44 loc) · 3.28 KB

SteamIDParser

Kind: global class

new SteamIDParser(apiKey, [options])

A SteamIDParser instance

Param Type Default Description
apiKey string API key that will be used for any requests, can be overriden per request
[options] Object Contains optional settings for the parser
[options.checkForAccountID] boolean false Sets whether the parser should check if the input given is an accountid if it's a number. checkNumberForVanity is recommended to be off if this setting is on. This setting would be useful for any Dota 2 api's as Dota 2 relies on accountids.
[options.checkNumberForVanity] boolean true Sets whether the parser should check for a matching vanity if the input is a number. Recommended to turn off if you have checkForAccountID on.

steamIDParser.get(input, [options]) ⇒ Promise

Gets a node-steamid object for a user from a given input

Kind: instance method of SteamIDParser
Returns: Promise - Returns node-steamid object for the steamid, rejects if not

Param Type Default Description
input string | Number the input, steam64, STEAM_, vanity url, link to profile, etc
[options] Object Contains optional settings for the parser
[options.apiKey] string optional, if not given uses apiKey from constructor
[options.checkForAccountID] boolean false Sets whether the parser should check if the input given is an accountid if it's a number. checkNumberForVanity is recommended to be off if this setting is on. This setting would be useful for any Dota 2 api's as Dota 2 relies on accountids.
[options.checkNumberForVanity] boolean true Sets whether the parser should check for a matching vanity if the input is a number. Recommended to be off if you have checkForAccountID on.

steamIDParser._cleanURL(url)

Helper function to remove everything except the last path in a url, e.g. _cleanURL("https://example.com/asdf/") = asdf

Kind: instance method of SteamIDParser

Param Type Description
url string URL to chop

steamIDParser._getSteamIDFromVanity(vanity, [apiKey])

Helper function to get a SteamID64 from a vanity

Kind: instance method of SteamIDParser

Param Type Description
vanity string the vanity of a user
[apiKey] string optional, if not given uses apiKey from constructor