@darco2903/uniserverz
v0.4.2
Published
UniServerZ Control
Readme
UniServerZ NodeJS Controller
Description
This package provides a simple interface to control Uniform Server, a lightweight WAMP server solution for Windows. It allows you to start and stop Apache and MySQL services, as well as check their running status.
[!WARNING] As UniformServer is a Windows-only application, this package is designed to work exclusively on Windows environments.
Installation
npm install @darco2903/uniserverzUsage
import { Uni } from "@darco2903/uniserverz";
// Path to UniServerZ base folder
// e.g. C:/UniServerZ if UniController.exe is located in C:/UniServerZ/UniController.exe
const UNI_PATH = "C:/UniServerZ";
(async () => {
const u = await Uni.createUni(UNI_PATH);
console.log("Uni created.");
await u.isApacheRunning().then((res) => console.log("isApacheRunning", res));
await u.isMysqlRunning().then((res) => console.log("isMysqlRunning ", res));
await u.isBothRunning().then((res) => console.log("isBothRunning ", res));
await u.startApache();
console.log("Apache started.");
await u.isApacheRunning().then((res) => console.log("isApacheRunning", res));
await u.stopApache();
console.log("Apache stopped.");
await u.isApacheRunning().then((res) => console.log("isApacheRunning", res));
await u.startMysql();
console.log("MySQL started.");
await u.isMysqlRunning().then((res) => console.log("isMysqlRunning ", res));
await u.stopMysql();
console.log("MySQL stopped.");
await u.isMysqlRunning().then((res) => console.log("isMysqlRunning ", res));
await u.startBoth();
console.log("Both started.");
await u.isBothRunning().then((res) => console.log("isBothRunning ", res));
await u.stopBoth();
console.log("Both stopped.");
await u.isBothRunning().then((res) => console.log("isBothRunning ", res));
})();