xplane-udp
v2.0.0
Published
XPlane UDP Client for Node.js
Readme
XPlane UDP 
XPlane UDP Client for Node.js
Requirements
- NodeJS (v6.X.X)
- Xplane 11
Usage
// Import XPlane class from the package
import { XPlaneClient } from "xplane-udp"
// Create a client on a specific port (this is a value you define in your xplane game settings)
const client = new XPlaneClient(49000)
// Start the UDP listener
client.start()
// Subscribe to the updated event
// This will fire at the rate at which you send UDP updates (set in-game)
client.on("updated", (data) => {
// Do something with the data
console.log(data)
})
// You can also access the data directly from the client instance
callMeMaybe(() => {
// Access data in the following format `<client>.data.<group>.<value>`
console.log(client.data.time.real)
console.log(client.data.airspeed.indicated)
})
Output Data Format (XPlaneUpdate interface)
Below is the structure of the data object returned in the updated event, or otherwise accesible directly from client.data.<group>.<value>.
timereal- [s]total- [s]mission- [s]timer- [s]zulu- [hh.ss]local- [hh.ss]hobbs
airspeedindicated- KIAS [kts]equivalent- KEAS [kts]true- KTAS [kts]truegnd- KTGS [kts]mph- IAS [mph]mphair- [mph]mphgnd- [mph]
gloadmach- Mach number [ratio]vvi- VVI [fpm]normalaxialside
angularmomentm- [ftlb]l- [ftlb]n- [ftlb]
angularvelocityq- [rad/s]p- [rad/s]r- [rad/s]
attitudepitch- [deg]roll- [deg]truehdg- [deg]maghdg- [deg]
aoaalpha- [deg]beta- [deg]hpath- [deg]vpath- [deg]slip- [deg]
compassmag- [comp]mavar- [deg]
globalpositionlat- [deg]lon- [deg]altmsl- [ft]altagl- [ft]runway- [runway no.]altind- [ft]latnormlonnorm
simpositionx- [m]y- [m]z- [m]vx- [m/s]vy- [m/s]vz- [m/s]distft- [ft]distnm- [nm]
throttlecommand[1..8]
throttleactual[1..8]
enginepower[1..8]- [hp]
enginethrust[1..8]
enginetorque[1..8]
enginerpm[1..8]
proprpm[1..8]
proppitch[1..8]
enginewash- propwash or jetwash[1..8]- [kts]
n1- turbine N1 %[1..8]- [%]
n2- turbine N2 %[1..8]- [%]
fuelflow[1..8]- [lb/h]
itt[1..8]- [deg]
egt[1..8]- [deg]
cht[1..8]- [deg]
oilpressure[1..8]- [psi]
oiltemp[1..8]- [deg]
fuelpressure[1..8]- [psi]
aeroforcelift- [lb]drag- [lb]side- [lb]
engineforcenormal- [lb]axial- [lb]side- [lb]
Contibute to the code
- Clone the Repo onto your local machine
- Install the dependancies:
npm i - Build the code (ts->js):
npm run typescript(ortypescript-watchto watch) - Contribute!
Running the tests
- Clone the Repo onto your local machine
- Install the dependancies:
npm i - Build the code (ts->js):
npm run typescript - Run the tests:
npm run test
