# pitect

> Detects if node is currently running on a Raspberry Pi.

Latest version **1.1.1** (published 2018-06-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install pitect
pnpm add pitect
yarn add pitect
bun add pitect
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-06-10 |
| First published | 2017-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nicholas Mata |
| Maintainers | nicholasmata |
| Keywords | raspberry, raspberry pi, pi model, pi revision, pi detection |

## Links

- npm: https://www.npmjs.com/package/pitect
- Repository: https://github.com/nicholasmata/pitect
- Homepage: https://github.com/nicholasmata/pitect#readme
- Issues: https://github.com/nicholasmata/pitect/issues
- npm.io page: https://npm.io/package/pitect

## Recent versions

- 1.1.1 (latest) — 2018-06-10
- 1.1.0 — 2018-06-10
- 1.0.7 — 2018-03-28
- 1.0.6 — 2017-08-24
- 1.0.5 — 2017-08-15
- 1.0.4 — 2017-08-15
- 1.0.3 — 2017-05-29
- 1.0.2 — 2017-05-29
- 1.0.1 — 2017-05-29
- 1.0.0 — 2017-05-29

## README

# pitect [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]

[travis-image]: https://img.shields.io/travis/NicholasMata/pitect/master.svg
[travis-url]: https://travis-ci.org/NicholasMata/pitect
[npm-image]: https://img.shields.io/npm/v/pitect.svg
[npm-url]: https://npmjs.org/package/pitect
[downloads-image]: https://img.shields.io/npm/dm/pitect.svg
[downloads-url]: https://npmjs.org/package/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

```js
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

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

---
_Source: https://npm.io/package/pitect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
