fix(smartsystem): Normalize package scopes, update dev dependencies and tooling, add pnpm workspace and packageManager, remove GitLab CI, and update imports/docs/tests

This commit is contained in:
2025-08-29 12:33:51 +00:00
parent f87fa3bf2b
commit 3eac579317
10 changed files with 9219 additions and 804 deletions

View File

@@ -1,5 +1,14 @@
# @push.rocks/smartsystem
interact with the system you are running on
Interact with the system your Node.js app runs on.
## Features
- Simple class: expose system info through a single `Smartsystem` instance
- 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
@@ -31,9 +40,20 @@ To use the functionalities provided by `@push.rocks/smartsystem`, you need to cr
const mySystem = new Smartsystem();
```
## API Overview
- `Smartsystem.env`: instance of `Smartenv` from `@push.rocks/smartenv`
Useful for reading and validating environment variables.
- `Smartsystem.cpus`: result of `os.cpus()`
Array of CPU core descriptions from Nodes builtin `os` module.
- `Smartsystem.network`: instance of `SmartNetwork` from `@push.rocks/smartnetwork`
Inspect interfaces, addresses, and network details.
- `Smartsystem.information`: re-export of `systeminformation`
Call any method, e.g. `osInfo()`, `system()`, `currentLoad()`, `networkStats()`.
### Accessing Environment Variables
`@push.rocks/smartsystem` integrates with `@pushrocks/smartenv` to provide an easy way to handle environment variables.
`@push.rocks/smartsystem` integrates with `@push.rocks/smartenv` to provide an easy way to handle environment variables.
```typescript
console.log(mySystem.env.getEnvVars());
@@ -49,7 +69,7 @@ console.log(mySystem.cpus[0]); // Logs details about the first CPU
### Working with Network Interfaces
The module allows you to work with network interfaces, making use of `@pushrocks/smartnetwork`:
The module allows you to work with network interfaces, making use of `@push.rocks/smartnetwork`:
```typescript
(async () => {