1.4.8 • Published 9 months ago

npm_f1mv_api v1.4.8

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

NPM_F1MV_API

Talk with the MulitiViewer API easily

Intro

This package is a Node.js wrapper around MulitiViewer.

You can use it to start building projects using the MultiViewer Live Timing API...

Install

npm install npm_f1mv_api

Usage

import {
    discoverF1MVInstances,
    getAPIVersion,
    getF1MVVersion,
    LiveTimingAPIV1,
    LiveTimingAPIV2,
    LiveTimingAPIGraphQL,
    Config
} from "npm_f1mv_api";

(async () => {
    let port;

    try {
        port = (await discoverF1MVInstances("localhost")).port;
    } catch (error) {
        console.error(
            "No MultiViewer instances founded on the requested host. Check if MultiViewer is running or if MultiViewer is allowed in your FireWall rules."
        );
        return;
    }

    const config: Config = {
        host: "localhost",
        port: port,
    };

    console.log(await discoverF1MVInstances(config.host));
    console.log(await getF1MVVersion(config));
    console.log(await getAPIVersion(config));
    console.log(await LiveTimingAPIV1(config, "TrackStatus"));
    console.log(await LiveTimingAPIV2(config, ["TrackStatus", "WeatherData"]));
    console.log(
        await LiveTimingAPIGraphQL(config, ["TrackStatus", "WeatherData"])
    );
})();

Docs

See the auto-generated docs for more info on methods and parameters.

Demos

To run the included demo:

  1. clone repo
  2. install node deps
  3. then in your terminal run
ts-node test/demo.ts

Projects

All of these awesome projects are built using the npm_f1mv_api package. 🤯

Be the first to create a project !

If you create a cool integration, feel free to open a PR and add it to the list.

Compatibility

This package is ESM-only.

Credits

1.4.6

9 months ago

1.4.8

9 months ago

1.4.7

9 months ago

1.2.0

1 year ago

1.4.1-rc1

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago