fan-time
v1.3.0
Published
Fetch and monitor fan.voidium.uk fan time and stats
Readme
use it like this i got nothing else to say
const FanTime = require('fan-time'); // or 'fan-time' if installed via npm
// Create a FanTime instance with 2-second polling interval
const fan = new FanTime({ interval: 2000 });
(async () => {
console.log('--- ONE-TIME FETCH ---');
// Fetch raw data
const rawData = await fan.fetchRaw();
console.log('Raw fan data:', rawData);
// Get individual fields
const time = await fan.getTime();
const rpm = await fan.getRPM();
const pulsesPerSecond = await fan.getPulsesPerSecond();
console.log('Fan Time:', time);
console.log('RPM:', rpm);
console.log('Pulses/s:', pulsesPerSecond);
console.log('\n--- START POLLING ---');
// Start polling with a callback
fan.startPolling(data => {
console.log('Updated fan data:', data);
});
// Stop polling after 10 seconds
setTimeout(() => {
fan.stopPolling();
console.log('Polling stopped.');
}, 10000);
})();