From 019508be2d1a7218010fdb5b0c0f4b3a458e3d14 Mon Sep 17 00:00:00 2001 From: WeeXnes Date: Mon, 16 Jun 2025 01:50:46 +0200 Subject: [PATCH] added readme --- README.md | 28 +++++++++++++++++++++++++++- src/cpu.ts | 3 --- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ac3b04..506d735 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,30 @@ ## 🚀 Installation ```bash npm install promstats -``` \ No newline at end of file +``` + +## 🔧 Configuration +Before using any functions, you must configure the Prometheus endpoint: +```js +import { setUrlEndpoint } from 'promstats'; +setUrlEndpoint('http://localhost:9090'); +``` + +## Usage: +```js +import { setUrlEndpoint, CPU, RAM, System } from 'promstats'; + +setUrlEndpoint('http://localhost:9090'); + +CPU.getCpuLoad().then(load => { + console.log('CPU Load:', load); +}); + +RAM.getUsedMemory().then(used => { + console.log('Used Memory:', used); +}); + +System.getOsName().then(os => { + console.log('OS Name:', os); +}); +``` diff --git a/src/cpu.ts b/src/cpu.ts index 47ac45d..a604f16 100644 --- a/src/cpu.ts +++ b/src/cpu.ts @@ -172,7 +172,4 @@ export class CPU { return null; } } - - - }