Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

steamapi

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

steamapi - npm Package Compare versions

Comparing version 2.4.2 to 2.5.0

2

package.json

@@ -6,3 +6,3 @@ {

"main": "index.js",
"version": "2.4.2",
"version": "2.5.0",
"license": "MIT",

@@ -9,0 +9,0 @@ "eslintConfig": {

@@ -72,3 +72,3 @@ ## SteamAPI

* [.getGameAchievements(app)](#SteamAPI+getGameAchievements) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.getGameDetails(app, [force], [region])](#SteamAPI+getGameDetails) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.getGameDetails(app, [force], [region], [language])](#SteamAPI+getGameDetails) ⇒ <code>Promise.&lt;Object&gt;</code>
* [.getGameNews(app)](#SteamAPI+getGameNews) ⇒ <code>Promise.&lt;Array.&lt;Object&gt;&gt;</code>

@@ -166,5 +166,7 @@ * [.getGamePlayers(app)](#SteamAPI+getGamePlayers) ⇒ <code>Promise.&lt;number&gt;</code>

### steamAPI.getGameDetails(app, [force], [region]) ⇒ <code>Promise.&lt;Object&gt;</code>
### steamAPI.getGameDetails(app, [force], [region], [language]) ⇒ <code>Promise.&lt;Object&gt;</code>
Get details for app id.
<warn>Requests for this endpoint are limited to 200 every 5 minutes</warn>
<warn>Not every `region` is supported. Only the following are valid: `us, ca, cc, es, de, fr, ru, nz, au, uk`.</warn>
<warn>Not every `language` is supported. A list of available languages can be found [here](https://www.ibabbleon.com/Steam-Supported-Languages-API-Codes.html).</warn>

@@ -178,3 +180,4 @@ **Kind**: instance method of [<code>SteamAPI</code>](#SteamAPI)

| [force] | <code>boolean</code> | <code>false</code> | Overwrite cache |
| [region] | <code>string</code> | <code>&quot;us&quot;</code> | Store region |
| [region] | <code>string</code> | <code>&quot;us&quot;</code> | Currency region |
| [language] | <code>string</code> | <code>&quot;english&quot;</code> | Description language |

@@ -181,0 +184,0 @@ <a name="SteamAPI+getGameNews"></a>

@@ -17,3 +17,4 @@ const SteamID = require('steamid');

const { version, name } = require('../package.json');
const regions = ['us', 'ca', 'cc', 'es', 'de', 'fr', 'ru', 'nz', 'au', 'uk'];
const allowedRegions = ['us', 'ca', 'cc', 'es', 'de', 'fr', 'ru', 'nz', 'au', 'uk'];
const allowedLanguages = ['arabic', 'bulgarian', 'schinese', 'tchinese', 'czech', 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'greek', 'hungarian', 'italian', 'japanese', 'koreana', 'norwegian', 'polish', 'brazilian', 'portuguese', 'romanian', 'russian', 'latam', 'spanish', 'swedish', 'thai', 'turkish', 'ukrainian', 'vietnamese'];
const reApp = /^\d{1,7}$/;

@@ -175,13 +176,17 @@ const reID = /^\d{17}$/;

* <warn>Requests for this endpoint are limited to 200 every 5 minutes</warn>
* <warn>Not every `region` is supported. Only the following are valid: `us, ca, cc, es, de, fr, ru, nz, au, uk`.</warn>
* <warn>Not every `language` is supported. A list of available languages can be found [here](https://www.ibabbleon.com/Steam-Supported-Languages-API-Codes.html).</warn>
* @param {string} app App ID
* @param {boolean} [force=false] Overwrite cache
* @param {string} [region=us] Store region
* @param {string} [region=us] Currency region
* @param {string} [language=english] Description language
* @returns {Promise<Object>} App details for ID
*/
getGameDetails(app, force = false, region = 'us') {
getGameDetails(app, force = false, region = 'us', language = 'english') {
if (!reApp.test(app)) return Promise.reject(TypeError('Invalid/no app provided'));
if (!regions.includes(region)) return Promise.reject(TypeError('Invalid region provided'));
if (!allowedRegions.includes(region)) return Promise.reject(TypeError('Invalid region provided'));
if (!allowedLanguages.includes(language)) return Promise.reject(TypeError('Invalid language provided'));
const request = () => this
.get(`/appdetails?appids=${app}&cc=${region}`, this.baseStore)
.get(`/appdetails?appids=${app}&cc=${region}&l=${language}`, this.baseStore)
.then(json => json[app].success

@@ -191,4 +196,5 @@ ? json[app].data

);
const key = `${app}-${region.toLowerCase()}`;
const key = `${app}-${region}-${language}`;
if (!force && this.options.enabled && this.cache.has(key) && this.cache.get(key)[0] > Date.now())

@@ -195,0 +201,0 @@ return Promise.resolve(this.cache.get(key)[1]);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc