pitect
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

Package Sidebar

Install

npm i pitect

Weekly Downloads

6

Version

1.1.1

License

MIT

Unpacked Size

8.16 kB

Total Files

8

Last publish

Collaborators

  • nicholasmata