Detect if node is currently running on a raspberry pi.
npm install detect-rpi --save
const isPi = require('detect-rpi');
if (isPi()) {
console.log('Running on Raspberry Pi!');
} else {
// ...
}
Reads /proc/cpuinfo and checks for the hardware model.