Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yashkathe/raspberrypi-sys-info-library
A Node.js library to retrieve system information (temperature, memory usage, disk activity, etc.) from a Raspberry Pi. This library wraps system calls in Node.js using Typescript for easy access to Raspberry Pi's hardware stats
https://github.com/yashkathe/raspberrypi-sys-info-library
Last synced: 28 days ago
JSON representation
A Node.js library to retrieve system information (temperature, memory usage, disk activity, etc.) from a Raspberry Pi. This library wraps system calls in Node.js using Typescript for easy access to Raspberry Pi's hardware stats
- Host: GitHub
- URL: https://github.com/yashkathe/raspberrypi-sys-info-library
- Owner: yashkathe
- License: mit
- Created: 2024-06-11T17:57:40.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2024-06-15T22:07:35.000Z (5 months ago)
- Last Synced: 2024-10-09T18:04:06.516Z (28 days ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/raspberrypi-sys-info
- Size: 188 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Raspberry PI Sys
This project is an npm library for extracting various metrics from Raspberry Pi.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Functions](#functions)
- [Contributing](#contributing)
- [License](#license)## Installation
To use this library in your project, you need to install it via npm. Make sure you have Node.js and npm installed.
```bash
npm i raspberrypi-sys-info
```## Usage
Below is an example of how to use the library to fetch and display various metrics from a Raspberry Pi.
### Example Code
```typescript
import { getCpuTemperature, getGpuTemperature } from 'raspberrypi-sys-info';async function displaySystemInfo() {
try {
const cpuTemp = await getCpuTemperature();
console.log(`CPU Temperature: ${cpuTemp}°C`);const gpuTemp = await getGpuTemperature();
console.log(`GPU Temperature: ${gpuTemp}°C`);} catch (error) {
console.error(error.message);
}
}displaySystemInfo();
```## Functions
### `getCPUTemperature()`
Returns the CPU temperature in degrees Celsius.### `getGpuTemperature()`
Returns the GPU temperature in degrees Celsius.## Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes.
4. Commit your changes (`git commit -m 'Add some feature'`).
5. Push to the branch (`git push origin feature-branch`).
6. Open a pull request.## License
This project is licensed under the MIT License.