npm.io
1.1.1 • Published 8 years ago

pitect

Licence
MIT
Version
1.1.1
Deps
0
Size
8 kB
Vulns
0
Weekly
0
Stars
1

pitect travis npm downloads

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');
    }
}

Keywords