Skip to content

Native Node module for interfacing with FSUIPC

License

Notifications You must be signed in to change notification settings

tcavenezuela/fsuipc-node

 
 

Repository files navigation

fsuipc-node

Node bindings to FSUIPC for Windows x64.

This repository contains two packages:

  • fsuipc: Node bindings to FSUIPC for Windows x64.
  • fsuipc-wasm: Node bindings to the FSUIPC WASM interface for Windows x64.

The fsuipc package can be used to read and write data from and to FSUIPC.

NPM Version Downloads Stats

Installation

npm install --save fsuipc

Or

yarn add fsuipc

Usage example

const fsuipc = require('fsuipc');

const obj = new fsuipc.FSUIPC();

obj.open()
    .then((obj) => {
      console.log(obj.add('clockHour', 0x238, fsuipc.Type.Byte));
      console.log(obj.add('aircraftType', 0x3D00, fsuipc.Type.String, 256));
      console.log(obj.add('lights', 0x0D0C, fsuipc.Type.BitArray, 2));

      return obj.process();
    })
    .then((result) => {
      console.log(JSON.stringify(result));

      return obj.close();
    })
    .catch((err) => {
      console.error(err);
      
      return obj.close();
    });

The fsuipc-wasm package can be used to read and write Lvars from and to FSUIPC using the WASM interface. Only for Microsoft Flight Simulator.

NPM Version Downloads Stats

Installation

npm install --save fsuipc-wasm

Or

yarn add fsuipc-wasm

Usage example

const fsuipcWasm = require('fsuipc-wasm');

const obj = new fsuipcWasm.FSUIPCWASM();

await obj.start();

console.log(obj.lvarValues);

obj.flagLvarForUpdate("A32NX_IS_STATIONARY");

obj.setLvarUpdateCallback((newLvars) => {
  console.log(newLvars);
});

Meta

Distributed under the MIT license. See LICENSE for more information.

https://github.com/koesie10/fsuipc-node

Contributing

  1. Fork it (https://github.com/koesie10/fsuipc-node/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Publishing a new version

  1. Run yarn lerna version to bump the version of all packages
  2. Create a release on GitHub with the new version number
  3. GitHub Actions will automatically publish the new version to NPM

About

Native Node module for interfacing with FSUIPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 89.7%
  • Python 5.6%
  • JavaScript 2.6%
  • TypeScript 2.1%