Interact with the system your Node.js app runs on.
**Smart System Interaction for Node.js**
## Features
> Zero-hassle system information and environment management for modern Node.js applications.
- Simple class: expose system info through a single `Smartsystem` instance
## 🌟 Features
- Env access: read and manage env vars via `@push.rocks/smartenv`
- CPU info: get `os.cpus()` without importing `os`
- Network utilities: high-level helpers from `@push.rocks/smartnetwork`
- Deep stats: tap into `systeminformation` for OS, hardware, and load data
- TypeScript-first: typed API, works great from TS and JS
## Install
`@push.rocks/smartsystem` consolidates system interaction into a single, elegant TypeScript-first API:
To incorporate @push.rocks/smartsystem into your project, you'll need to install the package via npm. You can do this by running the following command in your project's root directory:
- 🔧 **Unified System Interface** - One `Smartsystem` instance to rule them all
- 💻 **CPU Information** - Direct access to CPU specs without the boilerplate
- 🌐 **Network Intelligence** - Advanced networking utilities from [@push.rocks/smartnetwork](https://www.npmjs.com/package/@push.rocks/smartnetwork)
- 📊 **Deep System Insights** - Comprehensive hardware and OS data via [systeminformation](https://www.npmjs.com/package/systeminformation)
- ⚡ **TypeScript Native** - Built with TypeScript, for TypeScript (but works great with JS too!)
## 📦 Installation
Get started with your package manager of choice:
```bash
```bash
npm install @push.rocks/smartsystem --save
# Using npm
npm install @push.rocks/smartsystem
# Using pnpm (recommended)
pnpm add @push.rocks/smartsystem
# Using yarn
yarn add @push.rocks/smartsystem
```
```
This command will download @push.rocks/smartsystem and add it to your project's `package.json` file as a dependency.
## 🚀 Quick Start
## Usage
The `@push.rocks/smartsystem` module offers a convenient way to interact with the system your application is running on. Below are detailed examples that demonstrate how to utilize its full potential. These examples are written in TypeScript and showcase different cases and features of the module.
### Getting Started
First, ensure that you are importing the module correctly in your TypeScript file:
```typescript
```typescript
import{Smartsystem}from'@push.rocks/smartsystem';
import{Smartsystem}from'@push.rocks/smartsystem';
// Create your system interface
constmySystem=newSmartsystem();
// You're ready to rock! 🎸
```
```
### Creating an Instance of Smartsystem
## 📖 API Overview
To use the functionalities provided by `@push.rocks/smartsystem`, you need to create a new instance of the `Smartsystem` class.
The `Smartsystem` class provides these powerful properties:
| Property | Type | Description |
|----------|------|-------------|
| `env` | `Smartenv` | Environment variable management with validation and type safety |
| `cpus` | `os.CpuInfo[]` | Direct access to CPU core information |
`@push.rocks/smartsystem` offers a comprehensive toolkit for interacting with the underlying system your Node.js application runs on. From retrieving environment variables and CPU information to monitoring network interfaces and system load, this module provides everything you need to ensure your application can intelligently respond to its operating environment.
Make intelligent decisions based on system resources:
Remember, the examples above only scratch the surface of what's possible with `@push.rocks/smartsystem`. For more detailed documentation on all available methods and their capabilities, refer to the [official documentation](https://pushrocks.gitlab.io/smartsystem/).
description:'A TypeScript library for interacting with the system it'srunningon,includingenvironment,network,andhardwareinformation.'
description:'A TypeScript library for interacting with the system it'srunningon,includingenvironment,network,andhardwareinformation.'
}
}
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.