1.0.1 • Published 1 year ago

keenetic-control v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Keenetic API library

Latest Stable Version Downloads total Downloads month License

Paypal Donate Patreon Boosty

Installation

npm install keenetic-control --save

Usage

You can try example code

Once the new instance is initialized, authenticate and then you can use keenRequest

import { KeeneticAPI } from "keenetic-control";

const config = {
  ip: "192.168.1.1",
  login: "admin",
  pass: "pa$$word",
};

const keenetic = new KeeneticAPI(config.ip, config.login, config.pass);

keenetic.keenAuth().then((authenticated) => {
  if (authenticated) {
    keenetic
      .keenRequest("rci/show/interface/WifiMaster0")
      .then((response) => response.text())
      .then((text) => console.log(text))
      .catch((err) => console.error(err));
  } else {
    console.error("Authentication failed");
  }
});
1.0.1

1 year ago

1.0.0

1 year ago