fritzbox-api
Version:
Straightforward, lightweight and extendable Node.js library to communicate with FRITZ!Box devices
25 lines (19 loc) • 615 B
JavaScript
// Copyright (c) 2024, Thorsten A. Weintz. All rights reserved.
// Licensed under the MIT license. See LICENSE in the project root for license information.
import FritzBoxApi, { url } from './config.mjs';
/**
* Writes a message to the console.
*/
const log = console.log;
/**
* Initializes new instance of @see FritzBoxApi and sets options.
*/
const fritzBoxApi = new FritzBoxApi({ url });
/**
* Gets name of last user.
*/
const lastUser = await fritzBoxApi.getLastUser();
/**
* Prints last user name of @see FritzBoxApi to stdout.
*/
log('Last User: ' + (lastUser || 'None'));