Skip to content
/ thm-api Public

Unofficial TryHackMe Node.js/TypeScript library.

Notifications You must be signed in to change notification settings

fer/thm-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version

ThmApi

Unofficial TryHackMe Node.js/TypeScript library.

Install

npm i --save-dev thm-api

Usage

import { API, countryEnum } from 'thm-api'
const api = new API()

api.getLeaderboard('0day', 'US', (rank: number) => {
  console.log(rank)
})

Constructors

constructor

new ThmApi()

Accessors

countryList

get countryList(): Object

Returns an object with country code/name pairs.

readonly

memberof ThmApi

Returns

Object

Methods

checkIfUsernameExists

checkIfUsernameExists(username, callback): void

Checks for existence of an user.

Parameters

Name Type Description
username string TryHackMe username
callback Function Data callback function

Returns

void


getLeaderboard

getLeaderboard(username, countryCode, callback): void

Gets rank for an user in a country if provided.

Parameters

Name Type Description
username string TryHackMe username
countryCode string Country code
callback Function Data callback function

Returns

void


getNewRooms

getNewRooms(callback): void

Get a list with the newest released TryHackMe rooms.

Parameters

Name Type Description
callback Function Data callback function

Returns

void


getRoomDetails

getRoomDetails(roomName, callback): void

Get room details.

Parameters

Name Type Description
roomName string TryHackMe roomname
callback Function Data callback function

Returns

void


getRoomVotes

getRoomVotes(roomName, callback): void

Get votes for a given room name.

Parameters

Name Type Description
roomName string TryHackMe roomname
callback Function Data callback function

Returns

void


getSeries

getSeries(callback): void

Get learning paths.

Parameters

Name Type Description
callback Function Data callback function

Returns

void


searchUsername

searchUsername(username, callback): void

Searches for similar usernames. Used to invite users in the platform.

Parameters

Name Type Description
username string TryHackMe username
callback Function Data callback function

Returns

void

About

Unofficial TryHackMe Node.js/TypeScript library.

Resources

Stars

Watchers

Forks

Packages

No packages published