0.0.9 • Published 2 years ago

@sdiricco/relayjs v0.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

relayjs

The official javascript library to manage the relayjs board.

Installation

npm i relayjs

If you have problem see below

Basic Usage

const { RelayJs } = require("@sdiricco/relayjs");

let main = async () => {
  const relay = new RelayJs();

  try {
    relay.on("error", (e) => {
      console.log("error raised:", e);
    });

    console.log("connecting..");
    await relay.connect();
    console.log("connected");

    await relay.write(13, relay.CLOSE);

    console.log(relay.relays);

    if (relay.relays[13].state === relay.CLOSE) {
      console.log("relay 13 close");
    } else {
      console.log("relay 13 open");
    }
  } catch (e) {
    console.log("error catched:", e);
  }
};

main();
0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago