pitect
v1.1.1
Published
Detects if node is currently running on a Raspberry Pi.
Downloads
25
Maintainers
Readme
pitect
NodeJS module used for detecting if node project is running on a Raspberry Pi.
Features
- Detect if node project is running on a Raspberry Pi.
- Detect the specific Raspberry Pi model.
- Get the serial number of a Raspberry Pi
Install
npm install pitect --save
Usage
Javascript
const pitect = require('pitect');
if(pitect.isPi()) {
console.log('This is a Raspberry Pi.');
console.log('This is: ' + pitect.piModel().name);
console.log('Raspberry Pi Serial Number: ' + pitect.serialNumber());
if (pitect.piModel() == pitect.MODELS.PI_A) {
console.log('This is a Raspberry PI Model A');
}
}
Typescript
import * as pitect from 'pitect';
if(pitect.isPi()) {
console.log('This is a Raspberry Pi.');
console.log('This is: ' + pitect.piModel().name);
console.log('Raspberry Pi Serial Number: ' + pitect.serialNumber());
if (pitect.piModel() == pitect.MODELS.PI_A) {
console.log('This is a Raspberry PI Model A');
}
}