https://github.com/ahmetcanaksu/device-database
A library that detects collection of development boards.
https://github.com/ahmetcanaksu/device-database
nodejs orangepi raspberry-pi robotics rpi
Last synced: 4 months ago
JSON representation
A library that detects collection of development boards.
- Host: GitHub
- URL: https://github.com/ahmetcanaksu/device-database
- Owner: ahmetcanaksu
- License: apache-2.0
- Created: 2019-01-30T20:52:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-16T15:46:17.000Z (about 4 years ago)
- Last Synced: 2025-08-04T20:28:30.502Z (6 months ago)
- Topics: nodejs, orangepi, raspberry-pi, robotics, rpi
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Device-Database
A library that detects collection of development boards listed below.
#### Available devices on database
|Raspberry Pi | Orange Pi|
|--------------------|---------|
|Raspberry Pi 3 | Orange Pi PC |
|Raspberry Pi B+ | Orange Pi PC Plus |
|Raspberry Pi 2B | Orange Pi Plus |
|Raspberry Pi 3B | Orange Pi Lite |
|Raspberry Pi 3B+ | Orange Pi Plus 2 |
|Raspberry Pi A+ | Orange Pi Plus 2E |
|Raspberry Pi 3A+ | Orange Pi One |
|Raspberry Pi Zero | Orange Pi 2 |
|Raspberry Pi Zero W | Orange Pi PC 2 |
|Raspberry Pi CM3+ | Orange Pi Zero |
|Raspberry Pi CM3 | Orange Pi Prime |
## Install
```shell
$ npm i device-database
```
---
### Construct module
```js
const database = require("device-database");
const data = new database.data()
```
---
#### Get parsed data
Get parsed file from /proc/cpuinfo
```js
const data = new database.data()
console.log(data.getParsed());
/*
[ { processor: '0',
modelName: 'ARMv7 Processor rev 4 (v7l)',
bogomips: '76.81',
features: 'half thumb',
cpuImplementer: '0x41',
cpuArchitecture: '7',
cpuVariant: '0x0',
cpuPart: '0xd03',
cpuRevision: '4' },
...
{ hardware: 'BCM2835',
revision: 'a02082',
serial: 'serialid' } ]
*/
```
---
#### Get device data
Get device data
```js
const data = new database.data()
console.log(data.getDevice());
/*
{ hardware: 'BCM2835',
revision: 'a02082',
serial: 'serialid' }
*/
```
---
#### Get database data
Find device data exist on database
```js
const data = new database.data()
console.log(data.getResult());
/*
{ model: '3B',
revision: '1.2',
ram: 1024,
manufacturer: 'Sony UK',
brand: 'raspberry' }
*/
```
*Device results may different from others
---
#### Device exist
Check device exist on database
```js
const data = new database.data()
console.log(data.found());
/*
true || false
*/
```
---
#### Get experimental parser data
```js
const data = new database.data()
console.log(data.getParsed2());
/*
{
cpu1: {
modelName: 'ARMv7 Processor rev 4 (v7l)',
bogomips: '76.81',
features: 'half thumb',
cpuImplementer: '0x41',
cpuArchitecture: '7',
cpuVariant: '0x0',
cpuPart: '0xd03',
cpuRevision: '4'
},
...
device: {
cpuLength: 1,
hardware: 'BCM2835',
revision: 'a02082',
serial: 'serialid'
}
}
*/
```