Socket
Book a DemoInstallSign in
Socket

steam-level-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

steam-level-parser

Calculates statistical information about a steam level given the rate, price of keys, a user's current level and a user's wanted level

unpublished
latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

steam-level-parser

npm version npm downloads license

Calculates statistical information about a steam level given the rate, price of keys, a user's current level and a user's wanted level

Visit the example

Information about the module

This module allows you to calculate statistical information about a specific Steam level or the difference between two. The data you can calculate is:

  • The xp required for a level
  • The cards required for a level
  • The amount of sets required for a level
  • The amount of keys required for a level
  • The cost of a level
  • The maximum amount of friends a level offers
  • The maximum amount of showcases a level offers
  • The amount of coupons a level offers
  • The amount of bonuses a level offers

The calculated information bases the rate, key amount and total cost given that each set contains five cards. The parser will return the amount of friends, showcases, coupons and bonuses as a cumulative total between the base level and the wanted level. This is also true for the cost, amount of keys, amount of card sets, amount of cards and xp required. If no base level is submitted the parser defaults to base level 0.

Initialising the module

The module exposes a class that takes the parameters Rate and KeyPrice.

const LevelsCalculator = require('steam-level-parser');
const LevelParser      = new LevelsCalculator(18, 2.50);

The given example initiates the level parser with a key:card sets rate of 1:18 and a key price of $2.50. To update these variables use either the function LevelParser.UpdateRate() or LevelParser.UpdateKeyPrice() given the context of which variable you will be updating.

Calculating statistical data

The class exposes a function called Calculate. Given two arguments - a base level and a total level - the parser will calculate statistical information about each level and the differences between. If only the total amount is given the parser will default to a base level of 0.

Calling LevelParser.Calculate(10) will return the following object:

{
  Current: {
    Level: 0,
    Exp: 0,
    Friends: 250,
    Showcases: 0,
    Coupons: 0,
    Bonuses: 0,
    Sets: 0,
    Cards: 0,
    Keys: 0,
    Cost: 0,
    Yeezys: 0
  },
  Wanted: {
    Level: 10,
    Exp: 1000,
    Friends: 300,
    Showcases: 1,
    Coupons: 10,
    Bonuses: 30,
    Sets: 10,
    Cards: 50,
    Keys: 1,
    Cost: 2.25,
    Yeezys: 0
  },
  Intermediate: {
    Level: 10,
    Exp: 1000,
    Cards: 50,
    Friends: 50,
    Showcases: 1,
    Coupons: 10,
    Bonuses: 30,
    Sets: 10,
    Keys: 1,
    Cost: 2.25,
    Yeezys: 0
  }
}

The above object has three keys - Current, Wanted and Intermediate. The value of key Current contains statistical data for the base level. Since no base level was supplied the parser default to level 0.

Similarly, the value of key Wanted contains statistical data for the total level - in our case level 10. Intermediate contains the difference between the base level and the total level. Since the base level is 0, there is no difference between the intermediate and the total values.

To supply a base level, pass two arguments to the function LevelParser.Calculate(20, 150).

Yeezy data

@BrianOG specifically requested that this module contained the total pairs of yeezys a user could buy when supplied with their Steam level.

When initialising the module pass a third parameter to set the price of a pair of yeezys. If you want to update this price you can call LevelParser.UpdateYeezyPrice(Amount).

Each call to LevelParser.Calculate will return the total pairs of yeezys a user can buy for their current level, wanted level and the value inbetween. This information is based upon each card set containing five cards.

Given a key:card sets rate of 1:15, a key price of $2.25 and a yeezy price of $150 the needed Steam level to purchase a pair of yeezys would be level 136.

{ Level: 136,
  Exp: 99400,
  Cards: 4970,
  Friends: 680,
  Showcases: 13,
  Coupons: 994,
  Bonuses: 2982,
  Sets: 994,
  Keys: 67,
  Cost: 150.75,
  Yeezys: 1 }

FAQs

Package last updated on 03 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.