Gathering detailed insights and metrics for galeforce-tmp-sea
Gathering detailed insights and metrics for galeforce-tmp-sea
npm install galeforce-tmp-sea
Typescript
Module System
Min. Node Version
Node Version
NPM Version
57.3
Supply Chain
96.8
Quality
72.2
Maintenance
100
Vulnerability
85.9
License
TypeScript (66.12%)
JavaScript (33.88%)
Total Downloads
1,288
Last Day
7
Last Week
254
Last Month
828
Last Year
935
41 Stars
183 Commits
9 Forks
2 Watching
4 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
0.6.1
Package Id
galeforce-tmp-sea@0.6.1
Unpacked Size
486.58 kB
Size
81.60 kB
File Count
391
NPM Version
9.3.1
Node Version
18.14.1
Publised On
21 Feb 2023
Cumulative downloads
Total Downloads
Last day
-95.7%
7
Compared to previous day
Last week
-54.9%
254
Compared to previous week
Last month
8,180%
828
Compared to previous month
Last year
164.9%
935
Compared to previous year
A customizable, promise-based, and command-oriented TypeScript library and fluent interface for the Riot Games API.
debug
Automatically-generated documentation is available here, and code examples can be found the section below.
If you're using ES6/TypeScript, simply add
1import GaleforceModule from 'galeforce'; 2 3const galeforce = new GaleforceModule(/* config */);
to use the library. Or, if you're using CommonJS and require()
, add Galeforce to your project like this:
1const GaleforceModule = require('galeforce'); 2 3const galeforce = new GaleforceModule(/* config */);
1const summoners = ['a', 'b', 'c']; 2const promises = summoners.map(summoner => galeforce.lol.summoner() 3 .region(galeforce.region.lol.NORTH_AMERICA) 4 .name(summoner) 5 .exec() 6); // list of request promises 7Promise.all(promises).then((result) => { 8 console.log(result); // [{ name: 'a', ... }, ...] 9});
1const matchIds = await galeforce.lol.match.list() 2 .region(galeforce.region.riot.AMERICAS) 3 .puuid(puuid) 4 .exec();
1const matchData = await galeforce.lol.match.match() 2 .region(galeforce.region.riot.AMERICAS) 3 .matchId(matchId) 4 .exec();
1const totalMasteryPoints = (await galeforce.lol.mastery.list() 2 .region(galeforce.region.lol.NORTH_AMERICA) 3 .summonerId(summonerId) 4 .exec()) 5 .reduce((previous, current) => previous + current.championPoints, 0);
Each endpoint in the Galeforce library is an instance of an Action
containing the following methods:
.exec()
Executes the
Action
with the parameters set by methods such as.region()
,.summonerId()
, etc., returning a Promise.Example
1/* Gets Valorant platform and status data. */ 2galeforce.val.status() // Target the /val/status/v1/platform-data endpoint 3 .region(galeforce.region.val.NORTH_AMERICA) // See below for documentation. 4 .exec() // Sends a Valorant server status request to the val-status-v1 endpoint 5 .then((data) => { // Use the returned data 6 /* manipulate status data */ 7 });
.URL()
Returns the endpoint URL associated with the
Action
and its previously-set parameters.Example
1/* Gets the Data Dragon URL associated with the Galeforce icon. */ 2const galeforceURL = galeforce.lol.ddragon.item.art() // Fetch item icon art from Data Dragon 3 .version('11.9.1') // See the .<property>() section for documentation. Sets the version to retrieve data from. 4 .assetId(6671) // See below for documentation. Get the icon for the Galeforce item. 5 .URL(); // Get the encoded URL corresponding with the selected endpoint as a string. 6 7console.log(galeforceURL); // 'https://ddragon.leagueoflegends.com/cdn/11.9.1/img/item/6671.png'
.<property>()
Sets the property (
region
,summonerId
,puuid
, etc.) in the Action request payload. Different methods are exposed for each endpoint depending on the required path, query, and body parameters.Example
1/* Gets current game info for a specific summonerId. */ 2const currentGameInfo = await galeforce.lol.spectator.active() // Target the /lol/spectator/v4/active-games/by-summoner/{summonerId} endpoint 3 .region(galeforce.region.lol.NORTH_AMERICA) // Sets the request region to 'na1' (i.e., target the NA server) 4 .summonerId('summonerId') // Sets the request summonerId to 'summonerId' 5 .exec(); // See .exec() above.
.<property>()
methods may only be called once and are removed from the Action after being used.1/* Gets current game info for a specific summonerId. */ 2const currentGameInfo = await galeforce.lol.spectator.active() // Target the /lol/spectator/v4/active-games/by-summoner/{summonerId} endpoint 3 .region(galeforce.region.lol.NORTH_AMERICA) // Sets the request region to 'na1' (i.e., target the NA server) 4 .region(galeforce.region.lol.KOREA) // galeforce.lol.spectator.active(...).region(...).region is not a function
.set()
Sets multiple properties (
region
,summonerId
,puuid
, etc.) in the Action request payload simultaneously.Example
1/* Gets league entries for a given Teamfight Tactics ranked league. */ 2const TFTLeagueInfo = await galeforce.tft.league.entries() // Target the /tft/league/v1/entries/{tier}/{division} endpoint 3 .set({ // Set multiple Action payload properties simultaneously 4 region: galeforce.region.lol.NORTH_AMERICA, // Sets the request region to 'na1' (i.e., target the NA server) 5 tier: galeforce.tier.DIAMOND, // Sets the request tier to 'DIAMOND' (i.e., search for players in Diamond) 6 division: galeforce.division.IV, // Sets the request division to 'IV' (i.e., search for players in division IV of their tier) 7 }) 8 .exec(); // See .exec() above.
Galeforce includes DTOs for all Riot API responses as TypeScript interfaces. Although all actions already return an object typed with the corresponding DTO, these can be accessed explicitly via GaleforceModule.dto
or as another export:
1import GaleforceModule from 'galeforce'; 2 3const summonerData: GaleforceModule.dto.SummonerDTO = ... 4// get summoner data
1import GaleforceModule, { dto } from 'galeforce'; 2 3const summonerData: dto.SummonerDTO = ... 4// get summoner data
When initializing Galeforce, a config object (JSON) or a path to a YAML file may optionally be passed to the GaleforceModule()
constructor as an argument:
1const galeforce = new GaleforceModule(/* optional config file path or object */);
Omitting the config will prevent Galeforce from being able to interface with the Riot Games API (as no API key will be specified), although Data Dragon and the Live Client Data API will still be available.
Template string-like values (such as ${RIOT_KEY}
) will be evaluated using environment variables in process.env
. The configuration file may contain any of the following structure (all top-level fields are optional):
1riot-api: 2 key: 'RGAPI-???' # (string) Your Riot API key from https://developer.riotgames.com 3rate-limit: 4 type: 'bottleneck' # (string) The type of rate limiter Galeforce should use ('bottleneck', 'null') 5 cache: 6 type: ${CACHE_TYPE} # (string) What kind of cache to use ('redis', 'internal') 7 uri: ${CACHE_URI} # (string) The cache URI to connect to (required for 'redis' cache) 8 key-id: 'galeforce' # (string) The key ID to use for rate-limiting keys in the Redis cache 9 options: 10 intervals: # (key <seconds>: value <number of requests>) Manually-set local rate limits, applied per region 11 120: 100 12 1: 20 13 max-concurrent: null # (null | number) The maximum number of concurrent requests allowed. Setting to null allows unlimited concurrent requests. 14 min-time: 0 # (number) The minimum amount of time between consecutive requests 15 retry-count-after-429: 3 # (number) The number of retry attempts after an HTTP 429 error is received, delayed by response header 16debug: [] # A list containing any of 'action', 'payload', 'rate-limit', 'riot-api', '*' (all)
See here for further documentation and a complete list of methods.
Galeforce isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/28 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
project is not fuzzed
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More