
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
steam-level-parser
Advanced tools
Calculates statistical information about a steam level given the rate, price of keys, a user's current level and a user's wanted level
Calculates statistical information about a steam level given the rate, price of keys, a user's current level and a user's wanted level
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 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
.
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.
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)
.
@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
Calculates statistical information about a steam level given the rate, price of keys, a user's current level and a user's wanted level
We found that steam-level-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.