# rpi-info

> Allow to recognize and display information for the current RaspberryPi

Latest version **1.0.7** (published 2019-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install rpi-info
pnpm add rpi-info
yarn add rpi-info
bun add rpi-info
```

Provides the command `rpi-info`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-07-17 |
| First published | 2016-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Maxime Picaud |
| Maintainers | chok |
| Keywords | EDF Lab, rpi, version, revision, RaspberryPi, raspberry, model, releaseDate |

## Links

- npm: https://www.npmjs.com/package/rpi-info
- Repository: https://github.com/EDF-RetD-ICAME/node-rpi-info
- Homepage: https://github.com/EDF-RetD-ICAME/node-rpi-info#readme
- Issues: https://github.com/chok/node-rpi-info/issues
- npm.io page: https://npm.io/package/rpi-info

## Dependencies (9)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [yargs](https://npm.io/package/yargs.md) ^13.3.0
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.11.1
- [moment](https://npm.io/package/moment.md) ^2.13.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.6.0
- [commander](https://npm.io/package/commander.md) ^2.9.0
- [coffeescript](https://npm.io/package/coffeescript.md) ^2.4.1
- [underscore.string](https://npm.io/package/underscore.string.md) ^3.3.4

## Recent versions

- 1.0.7 (latest) — 2019-07-17
- 1.0.6 — 2019-07-17
- 1.0.5 — 2018-10-08
- 1.0.4 — 2017-05-27
- 1.0.3 — 2016-05-24
- 1.0.2 — 2016-05-24
- 1.0.1 — 2016-04-22
- 1.0.0 — 2016-04-22

## README

RPI Info
===========

Last update: 2019-07-18

[![npm version](https://img.shields.io/npm/v/rpi-info.svg?style=flat)](https://yarnpkg.com/en/package/rpi-info)
[![license](https://img.shields.io/npm/l/rpi-info.svg?style=flat)](https://opensource.org/licenses/MIT)

This library is written in coffee-script and allow to display information about the current RaspberryPi.
If no revision is provided, /proc/cpuinfo is parsed to retrieve the revision.

Rpis infos are taken from :

* http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
* http://elinux.org/RPi_HardwareHistory

Installation
------------

```rpi-info``` can be installed globally and used at command line or programmatically.

```
[sudo] npm install [-g] rpi-info
```

Usage
-----
```
Usage: rpi-info [options] [command]

Commands:

  field|f <field>  [version, model, releaseDate, revisions]
  after|a <date>   Check if this raspberry pi is released after the given date
  before|b <date>  Check if this raspberry pi is released before the given date
  unknown|u        Check if this raspberry pi has a recognized hardware revision
  all              Show all available infos for this raspberry pi

Options:

  -h, --help              output usage information
  -V, --version           output the version number
  -r, --revision [value]  Revision
  -s, --silent            Display raw information only
```

By default :
```
rpi-info
```

render something like :
```
RaspberryPi 3 Model B released Q1 2016
Revision : 'a02082'
All revisions availables for this kind of device : [ 'a02082', 'a22082' ]
```

Programmatically
----------------

```javascript
var RPI = require('rpi-info');
var rpi = new RPI(revision); // revision is optionnal - if not present, /proc/cpuinfo is parsed

rpi.getRevision();

rpi.getVersions();

rpi.getField(name);

rpi.getVersion();

rpi.getModel();

rpi.getReleaseDate();

rpi.getAllRevisions();

rpi.isReleasedBefore(date);

rpi.isReleasedAfter(date)

rpi.isUnknown();

rpi.getInfos();
```

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