added readme

This commit is contained in:
WeeXnes 2025-06-16 01:50:46 +02:00
parent 1f477106f3
commit 019508be2d
2 changed files with 27 additions and 4 deletions

View file

@ -18,4 +18,30 @@
## 🚀 Installation ## 🚀 Installation
```bash ```bash
npm install promstats npm install promstats
``` ```
## 🔧 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);
});
```

View file

@ -172,7 +172,4 @@ export class CPU {
return null; return null;
} }
} }
} }