fourcube / detect-rpi

Detects if node is running on a Raspberry Pi.
MIT License
18 stars 6 forks source link

npm version

detect-pi

Detect if node is currently running on a raspberry pi.

Usage

npm install detect-rpi --save

const isPi = require('detect-rpi');

if (isPi()) {
  console.log('Running on Raspberry Pi!');
} else {
  // ...
}

How?

Reads /proc/cpuinfo and checks for the hardware model.