npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

trucky-services-client

v0.2.1

Published

Trucky APP REST API client

Downloads

25

Readme

Trucky App REST API client for node.js

Build Status

npm version

This package is the Trucky API client, complete gateway to TruckersMP, ETS2Map and Traffic data served from TruckersMP developers community (official and unofficial).

For API response documentation please refer to live documentation (http://api.truckyapp.com/docs/)

Installation

npm install trucky-services-client

Usage

var TruckyAPIClient = require('trucky-services-client');

var api = new TruckyAPIClient();
api.servers().then((response) => {
    console.log(response);
});

api.pois().then(function(response) {
    console.log(response);
});

api.resolveVanityUrl("dowmeister").then( (response) => {
    console.log(response);
});

Dependencies

  • node-fetch: A light-weight module that brings window.fetch to node.js and io.js

API

Table of Contents

TruckyAPIClient

Trucky API client class

resolveVanityUrl

Resolve Steam Vanity Url returning Steam player data if found

Parameters

  • username string Steam user vanity url

Returns Promise<TruckyAPIResponse>

getPlayerSummaries

Returns Steam Player data if found

Parameters

Returns Promise<TruckyAPIResponse>

searchPlayer

Search player by Steam ID, Steam Username or TruckersMP ID based on searchType parameter

Parameters

  • searchTerm string Search Term, can be TruckersMP User ID, Steam User ID or Steam Vanity url
  • searchType string Can be "steamid", "truckersmpid", "steamusername"

Returns Promise<TruckyAPIResponse>

pois

Get ETS2Map Points of interest

Returns Promise<TruckyAPIResponse>

isOnline

Check TruckersMP player online status

Parameters

  • playerID number TruckersMP User ID

Returns Promise<TruckyAPIResponse>

isOnlineImproved

Check TruckersMP player online status - With improved informations, mapped map server and calculated location

Parameters

  • playerID number TruckersMP User ID

Returns Promise<TruckyAPIResponse>

getFriends

Get Steam Friends

Parameters

Returns Promise<TruckyAPIResponse>

news

Get TruckersMP news feed from Steam RSS

Returns Promise<TruckyAPIResponse>

ets2News

Get ETS2 News feed from Steam RSS

Returns Promise<TruckyAPIResponse>

atsNews

Get ATS News feed from Steam RSS

Returns Promise<TruckyAPIResponse>

update_info

Get TruckersMP current update info and current plugin version

Returns Promise<TruckyAPIResponse>

events

Get events and meetup from ETS2.com and truckers.events

Returns Promise<TruckyAPIResponse>

servers

Get TruckersMP servers

Returns Promise<TruckyAPIResponse>

game_version

Get TruckersMP game version info

Returns Promise<TruckyAPIResponse>

game_time

Get TruckersMP game time

Returns Promise<TruckyAPIResponse>

rules

Get TruckersMP rules

Returns Promise<TruckyAPIResponse>

player

Get TruckersMP player data

Parameters

Returns Promise<TruckyAPIResponse>

bans

Get TruckersMP player bans data

Parameters

Returns Promise<TruckyAPIResponse>

traffic

Get TruckersMP traffic data from traffic.krashnz.com

Parameters

  • server string TruckersMP Server short name
  • game string Can be "ETS2" or "ATS"

Returns Promise<TruckyAPIResponse>

traffic_servers

Get TruckersMP get traffic servers data from traffic.krashnz.com

Returns Promise<TruckyAPIResponse>

wot_gallery_random

Get World Of Trucks Random Gallery

Returns Promise<TruckyAPIResponse>

wot_gallery_editorspick

Get World Of Trucks Editor's pick

Returns Promise<TruckyAPIResponse>

wot_gallery_bestrated

Get World Of Trucks Best rated

Returns Promise<TruckyAPIResponse>

wot_gallery_mostviewed

Get World Of Trucks most viewed

Returns Promise<TruckyAPIResponse>

streams_twitch_ets2

Get current Twitch streams for ETS2

Returns Promise<TruckyAPIResponse>

streams_twitch_ats

Get current Twitch streams for ATS

Returns Promise<TruckyAPIResponse>

truckersfm_listeners

Get TruckersFM current listeners

Returns Promise<TruckyAPIResponse>

truckersfm_shows

Get TruckersFM current show

Returns Promise<TruckyAPIResponse>

truckersfm_lastPlayed

Get TruckersFM last played song

Returns Promise<TruckyAPIResponse>

onlineList

Get players online state by TruckersMP ids array Search TruckersMP player by username

Parameters

  • ids

Returns Promise<TruckyAPIResponse>

searchPlayerByTruckersMPUsername

Search TruckersMP Player by username

Parameters

  • query

Returns Promise<TruckyAPIResponse>

getPlayerInfoComplete

Get TruckersMP player complete information with online state and Steam profile data

Parameters

  • query

Returns Promise<TruckyAPIResponse>

ets2_cities

Get list of ETS2 cities, with coordinates and country

Returns Promise<TruckyAPIResponse>

ats_cities

Get list of ATS cities, with coordinates and country

Returns Promise<TruckyAPIResponse>

map_servers

Get Map servers list, mapped on API servers

Returns Promise<TruckyAPIResponse>

TruckyAPIResponse

Trucky API client response prototype

Type: object

Properties