Socket
Book a DemoInstallSign in
Socket

js-geofs

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-geofs

An abstraction layer for the GeoFS API (credit to iL0g1c).

latest
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

js-geofs

An abstraction layer for the GeoFS API (credit to iL0g1c for MapAPI & MultiplayerAPI)

Installation

  • Create your project directory and select it
    mkdir example-dir
    cd /path/to/example-dir
    
  • Install the package
    npm install js-geofs
    
  • You're all set! Read the MapAPI and MultiplayerAPI sections to find out more.

Components

MapAPI

The MapAPI is a way to access GeoFS's map data, which includes:

  • Users
  • User IDs
  • User account IDs
  • User aircraft IDs
  • User callsigns
  • User grounded status and airspeed
  • User coordinates
  • User vectors
  • User time

References

ECMAScript:

import { MapAPI } from "js-geofs";
const myAPI = new MapAPI();

CommonJS:

const geofs = require("js-geofs");
const myAPI = new geofs.MapAPI();

Methods

getUsers:

Parameters:

  • foos (Boolean), optional If true, will only return foos. If false, will only return non-foos. If not provided, will return all users.

Returns: List of users as per specifications

responseList.get:

Gets response history.

Parameters: N/A

Returns: Array of all previous results of getUsers calls

responseList.reset:

Clears responseList.

Parameters: N/A

Returns: undefined

responseList.enable, responseList.disable, responseList.toggle:

Enables, disables, or toggles the usage of the responseList.

Parameters: N/A

Returns: undefined

MultiplayerAPI

The MultiplayerAPI is a way to access GeoFS's multiplayer data, which includes:

  • Chat data
  • More detailed positioning information

References

ECMAScript:

import { MultiplayerAPI } from "js-geofs";
const myAPI = new multiplayerAPI(sessionID, accountID);

CommonJS:

const geofs = require("js-geofs");
const myAPI = new multiplayerAPI(sessionID, accountID);

The accountID value can be found here and is refered to as your "user ID" on the website.

The sessionID value can be found in the console. Sign into your account here and then open the console with ctrl+shift+j.

Then, paste this code in.

const cookies = document.cookie.split(';');
const sessionIdCookie = cookies.find(cookie => cookie.trim().startsWith('PHPSESSID='));
const sessionId = sessionIdCookie ? sessionIdCookie.split('=')[1] : null;
console.log(sessionId);

This should output a session ID that is basically a random string. Next, you need to make a handshake with the server.

myAPI.handshake();

Now you are setup and can use the API freely.

Methods

sendMsg:

Sends a specified message to GeoFS chat.

Parameters:

  • msg (String), required The message to send in GeoFS chat.

Returns: undefined.

getMessages:

Allows you to pull the most recent messages from the server.

It will only pull messages that occured, since the last time you used this command.

Parameters: N/A

Returns: Array of chat messages or null if connection was unsuccessful.

coords:

Either returns current coords or changes them.

Parameters:

  • coords (Array of 6 numbers), optional

    co 0 latitude

    co 1 longitude

    co 2 altitude in meters

    co 3 vertical speed in meters

    last two can be 0

Returns: undefined if parameter is passed or an array of current coords if it isn't passed.

GeoAPI

Geocodes a specified query.

References

ECMAScript:

import { GeoAPI } from "js-geofs";
const myAPI = new GeoAPI();

CommonJS:

const geofs = require("js-geofs");
const myAPI = new geofs.GeoAPI();

Methods

query:

Sends a request to GeoFS's geocoding backend and returns the response if found.

Parameters:

  • toQuery (String), required String to query/encode in the URL.

Returns: Response object or undefined if it couldn't be geocoded.

WeatherAPI

References

ECMAScript:

import { WeatherAPI } from "js-geofs";
const myAPI = new WeatherAPI();

CommonJS:

const geofs = require("js-geofs");
const myAPI = new geofs.WeatherAPI();

Methods

query:

Queries GeoFS's weather backend with the specified ICAO(s) and returns the airport's METAR if found.

Parameters:

  • toQuery (String), required String to query/encode in the URL.

Returns: Response object or undefined if no matching METAR was found.

Keywords

geofs

FAQs

Package last updated on 03 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.