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

extplanejs

v0.1.4

Published

A JavaScript Client Library for NodeJs that uses the ExtPlane-Plugin

Downloads

39

Readme

ExtPlaneJs

NPM version NPM version Dependency Status

A JavaScript Client Library for NodeJs that uses the ExtPlane plugin.

Inspired by ExtPlaneInterface for Java and ExtPlaneNet for C#

Prerequisites

  1. You need X-Plane (demo works fine) with the ExtPlane plugin installed.
  2. NodeJs >= 4.0.0

Installation

Install via NPM

$ npm install extplanejs

Connecting to X-Plane

Make sure X-Plane is started and the plugin is installed and active.

ExtPlaneJs Config

Either modify the config.json or modify the config object passed into ExtPlaneJs

{
    "host": "127.0.0.1",
    "port": 51000,
    "broadcast": false,
    "debug": true
}

Running the example connector

  1. Open your terminal
  2. cd to ExtPlaneJs
  3. Install Node.js Dependencies npm install
  4. Run npm start

Watch your terminal as your X-Plane information is streamed on-screen

Running the tests

  1. Make sure X-Plane is running and in a current flight. Not on the QuickFlight screen.
  2. Run npm test

Example

var ExtPlaneJs = require('extplanejs');

var ExtPlane = new ExtPlaneJs({
    host: '127.0.0.1',
    port: 51000,
    broadcast: true
});

ExtPlane.on('loaded', function(){

	ExtPlane.client.interval(0.33);

	// Subscribe to the airspeed
	ExtPlane.client.subscribe('sim/cockpit2/gauges/indicators/airspeed_kts_pilot');

	// Handle all data-ref changes
	ExtPlane.on('data-ref', function(data_ref, value){
		console.log(data_ref+' - '+value);
	});

});

ExtPlaneJS API

ExtPlaneJs(config)

Instantiate ExtPlaneJs and try connect

ExtPlaneJs.on(event)

Assign an event handler to the specific event

ExtPlaneJs.client.*

Access the client API from ExtPlaneJs

Events

  • loaded - No parameters
  • data-ref (data_ref, value) - Receive all data-ref events over one handler. Broadcast: true
  • sim/cockpit2/gauges/indicators/airspeed_kts_pilot (data_ref, value) - Receive individual data-ref events. Broadcast: false

Client API

client.key(key_id)

Press a key

client.once(cmd)

Execute a command

client.begin(cmd)

Begin a command

client.end(cmd)

End a command

client.button(button_id)

Press a button

client.release(button_id)

Release a button

client.set(data_ref, value)

Set a data refs value

client.subscribe(data_ref, [accuracy])

Subscribe to a data ref

client.unsubscribe(data_ref)

Unsubscribe to a data ref

client.interval(value)

Override the data update interval

client.disconnect()

Send the disconnect command

More information ?

See the example connector source in example.js for example subscriptions, methods available and event handlers for data refs

License

MIT License - Copyright © Bluu Interactive

Bluu