13 Commits

17 changed files with 16273 additions and 18545 deletions

View File

@@ -1,137 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

24
.vscode/launch.json vendored
View File

@@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

56
changelog.md Normal file
View File

@@ -0,0 +1,56 @@
# Changelog
## 2025-08-29 - 3.0.3 - fix(readme)
Update README: expand documentation, add installation, usage examples, API overview, and advanced guides
- Completely revamped README with a clearer project description and features list
- Added Installation section with npm / pnpm / yarn examples
- Added Quick Start, API overview, and multiple usage examples (env, CPU, network, systeminformation)
- Added Real-World Use Cases (health check, network monitoring, resource scaling) and Advanced Features (cross-platform, Docker detection)
- Clarified TypeScript support and added links to full API documentation
- Documentation-only changes; no code or API behaviour modified
## 2025-08-29 - 3.0.2 - fix(smartsystem)
Normalize package scopes, update dev dependencies and tooling, add pnpm workspace and packageManager, remove GitLab CI, and update imports/docs/tests
- Normalize package scope names from @pushrocks/* to @push.rocks/* across source, commit info and README
- Update dependency versions: bump @push.rocks/smartpromise to ^4.0.2 and ensure other @push.rocks packages use caret ranges
- Switch dev tooling namespaces to @git.zone (tsbuild/tsrun/tstest) and add @git.zone/tsrun
- Enhance npm scripts: make test run with verbose, logfile and increased timeout
- Add packageManager field (pnpm@10.14.0+sha512...) to package.json and add pnpm-workspace.yaml with onlyBuiltDependencies: [esbuild]
- Remove legacy .gitlab-ci.yml CI configuration
- Update imports in ts and test files to match new package namespaces
## 2024-05-29 - 3.0.1 - chore
Update of package metadata and TypeScript configuration.
- update description
- update tsconfig (adjustments to TypeScript config)
- update npmextra.json: githost (fixes to githost entries)
## 2022-07-28 - 3.0.0 - fix(core)
Minor core fixes and release of 3.0.0.
- fix(core): update
## 2022-07-28 - 2.0.10 - BREAKING (core)
Breaking change: module format switched to ESM.
- BREAKING CHANGE(core): switch to esm
- misc maintenance and fixes leading up to this release
## 2017-07-31 - 2.0.1..2.0.9 - maintenance
Series of patch releases with small fixes and upkeep across the 2.0.x line.
- Multiple patch releases (2.0.1 → 2.0.9) containing repeated core fixes
- Updates to README and repository metadata
- update yarn lock (notably in 2.0.1)
## 2017-07-31 - 1.0.0..1.0.18 - initial development & improvements
Initial development, feature additions and documentation improvements across 1.0.x.
- initial releases and basic module structure; first working version
- add npm as default module loader (1.0.6)
- improve path resolution and add keywords (1.0.41.0.5)
- add docs, improve README and tests across multiple 1.0.x releases
- CI updates and general streamlining of the project

View File

@@ -1,69 +0,0 @@
---
name: smartsystem
description: simplifies lazy loading with TypeScript
---
# smartsystem
simplifies lazy loading with TypeScript
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartsystem)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartsystem)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartsystem)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartsystem/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartsystem/badges/master/build.svg)](https://GitLab.com/pushrocks/smartsystem/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartsystem/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartsystem/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartsystem.svg)](https://www.npmjs.com/package/smartsystem)
[![Dependency Status](https://david-dm.org/pushrocks/smartsystem.svg)](https://david-dm.org/pushrocks/smartsystem)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartsystem/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartsystem/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartsystem/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartsystem)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
We recommend the use of TypeScript for best Intellisense
smartsystem supports both npm and SystemJs as module loader.
```javascript
import { LazyModule } from 'smartsystem';
// plugin does not get loaded here at runtime
import * as _myPlugin from 'myPlugin';
// define the lazy module
let myLazyModule = new LazyModule() < typeof _myPlugin > ('myPlugin', __dirname);
// another plugin
import * as _anotherPlugin from 'anotherPlugin'; // plugin does not get loaded here at runtime
// define lazy module
let anotherLazyModule = new LazyModule() < typeof _anotherPlugin > ('anotherPlugin', __dirname);
myLazyModule.whenLoaded.then((myPlugin) => {
/* do something with myPlugin.
myPlugin receives the typings flow from LazyModule class
This does NOT load the module during runtime
The promise whenLoaded will be resolved whenever load() is called for the first time */
});
myLazyModule.load().then((myPlugin) => {
/* do something with myPlugin.
myPlugin receives the typings flow from LazyModule class
This DOES LOAD the module */
});
```
For further information read the linked docs at the top of this README.
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

View File

@@ -6,12 +6,26 @@
"gitzone": { "gitzone": {
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "code.foss.global",
"gitscope": "pushrocks", "gitscope": "push.rocks",
"gitrepo": "smartsystem", "gitrepo": "smartsystem",
"shortDescription": "interact with the system you are running on", "description": "A TypeScript library for interacting with the system it's running on, including environment, network, and hardware information.",
"npmPackagename": "@pushrocks/smartsystem", "npmPackagename": "@push.rocks/smartsystem",
"license": "MIT" "license": "MIT",
"keywords": [
"TypeScript",
"system information",
"environment variables",
"network",
"hardware info",
"OS interaction",
"module loading",
"async",
"cross-platform"
]
} }
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

25620
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,47 @@
{ {
"name": "@pushrocks/smartsystem", "name": "@push.rocks/smartsystem",
"version": "2.0.10", "version": "3.0.3",
"description": "interact with the system you are running on", "description": "A TypeScript library for interacting with the system it's running on, including environment, network, and hardware information.",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/ --verbose --logfile --timeout 60)",
"build": "(tsbuild)" "build": "(tsbuild --web --allowimplicitany)",
"buildDocs": "tsdoc"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+ssh://git@gitlab.com/pushrocks/smartsystem.git" "url": "https://code.foss.global/push.rocks/smartsystem.git"
}, },
"keywords": [ "keywords": [
"TypeScript", "TypeScript",
"lazy", "system information",
"module loader" "environment variables",
"network",
"hardware info",
"OS interaction",
"module loading",
"async",
"cross-platform"
], ],
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"bugs": { "bugs": {
"url": "https://gitlab.com/pushrocks/smartsystem/issues" "url": "https://gitlab.com/pushrocks/smartsystem/issues"
}, },
"homepage": "https://gitlab.com/pushrocks/smartsystem#README", "homepage": "https://code.foss.global/push.rocks/smartsystem",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^4.0.20", "@push.rocks/lik": "^6.0.0",
"@pushrocks/smartenv": "^4.0.16", "@push.rocks/smartenv": "^5.0.2",
"@pushrocks/smartnetwork": "^2.0.10", "@push.rocks/smartnetwork": "^3.0.0",
"@pushrocks/smartpromise": "^3.1.6", "@push.rocks/smartpromise": "^4.0.2",
"systeminformation": "^5.8.0" "systeminformation": "^5.12.1"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@git.zone/tsbuild": "^2.1.63",
"@gitzone/tstest": "^1.0.54", "@git.zone/tsrun": "^1.3.3",
"@pushrocks/tapbundle": "^3.2.14", "@git.zone/tstest": "^1.0.72",
"tslint": "^6.1.3", "tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
@@ -52,5 +60,6 @@
], ],
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ],
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
} }

8474
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
onlyBuiltDependencies:
- esbuild

1
readme.hints.md Normal file
View File

@@ -0,0 +1 @@

271
readme.md
View File

@@ -1,40 +1,253 @@
# @pushrocks/smartsystem # @push.rocks/smartsystem 🚀
interact with the system you are running on **Smart System Interaction for Node.js**
## Availabililty and Links > Zero-hassle system information and environment management for modern Node.js applications.
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartsystem)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartsystem)
* [github.com (source mirror)](https://github.com/pushrocks/smartsystem)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartsystem/)
## Status for master ## 🌟 Features
Status Category | Status Badge `@push.rocks/smartsystem` consolidates system interaction into a single, elegant TypeScript-first API:
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartsystem/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartsystem/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartsystem)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartsystem)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartsystem)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartsystem)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartsystem)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage - 🔧 **Unified System Interface** - One `Smartsystem` instance to rule them all
- 🌍 **Environment Management** - Smart env variable handling via [@push.rocks/smartenv](https://www.npmjs.com/package/@push.rocks/smartenv)
- 💻 **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!)
We recommend the use of TypeScript for best Intellisense ## 📦 Installation
Get started with your package manager of choice:
## Contribution ```bash
# Using npm
npm install @push.rocks/smartsystem
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) # Using pnpm (recommended)
pnpm add @push.rocks/smartsystem
For further information read the linked docs at the top of this readme. # Using yarn
yarn add @push.rocks/smartsystem
```
> MIT licensed | **&copy;** [Lossless GmbH](https://lossless.gmbh) ## 🚀 Quick Start
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) ```typescript
import { Smartsystem } from '@push.rocks/smartsystem';
// Create your system interface
const mySystem = new Smartsystem();
// You're ready to rock! 🎸
```
## 📖 API Overview
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 |
| `network` | `SmartNetwork` | Network interface inspection and utilities |
| `information` | `systeminformation` | Full access to the systeminformation library |
## 💡 Usage Examples
### Environment Variables Made Easy
```typescript
const mySystem = new Smartsystem();
// Get all environment variables
const envVars = mySystem.env.getEnvVars();
// Access specific variables with type safety
const apiKey = mySystem.env.getEnvVarOnDemand('API_KEY');
```
### CPU Information at Your Fingertips
```typescript
const mySystem = new Smartsystem();
// Get CPU details
console.log(`Running on ${mySystem.cpus.length} CPU cores`);
console.log(`Primary CPU: ${mySystem.cpus[0].model}`);
```
### Network Intelligence
```typescript
const mySystem = new Smartsystem();
// Get comprehensive network information
const networkInfo = await mySystem.network.getNetworkInfo();
console.log('Network interfaces:', networkInfo);
```
### Deep System Insights
Access detailed system information for advanced use cases:
```typescript
const mySystem = new Smartsystem();
// Hardware information
const systemInfo = await mySystem.information.system();
console.log(`System: ${systemInfo.manufacturer} ${systemInfo.model}`);
// Operating system details
const osInfo = await mySystem.information.osInfo();
console.log(`OS: ${osInfo.distro} ${osInfo.release}`);
// Real-time system metrics
const load = await mySystem.information.currentLoad();
console.log(`CPU Load: ${load.currentLoad.toFixed(2)}%`);
// Memory usage
const mem = await mySystem.information.mem();
console.log(`Memory: ${(mem.used / mem.total * 100).toFixed(2)}% used`);
```
## 🎯 Real-World Use Cases
### System Health Monitoring
Create a simple health check for your application:
```typescript
const mySystem = new Smartsystem();
async function healthCheck() {
const load = await mySystem.information.currentLoad();
const mem = await mySystem.information.mem();
const disk = await mySystem.information.fsSize();
return {
status: 'healthy',
metrics: {
cpuLoad: `${load.currentLoad.toFixed(2)}%`,
memoryUsage: `${(mem.used / mem.total * 100).toFixed(2)}%`,
diskUsage: disk.map(fs => ({
mount: fs.mount,
usage: `${fs.use.toFixed(2)}%`
}))
}
};
}
```
### Network Traffic Analysis
Monitor network activity for debugging or performance optimization:
```typescript
const mySystem = new Smartsystem();
async function monitorNetwork() {
const defaultInterface = await mySystem.information.networkInterfaceDefault();
const baseline = await mySystem.information.networkStats(defaultInterface);
// Check again after 1 second
await new Promise(resolve => setTimeout(resolve, 1000));
const current = await mySystem.information.networkStats(defaultInterface);
const rxSpeed = (current[0].rx_sec / 1024 / 1024).toFixed(2);
const txSpeed = (current[0].tx_sec / 1024 / 1024).toFixed(2);
console.log(`📥 Download: ${rxSpeed} MB/s | 📤 Upload: ${txSpeed} MB/s`);
}
```
### Smart Resource Scaling
Make intelligent decisions based on system resources:
```typescript
const mySystem = new Smartsystem();
async function getOptimalWorkerCount() {
const cpuCount = mySystem.cpus.length;
const load = await mySystem.information.currentLoad();
const mem = await mySystem.information.mem();
// Scale workers based on available resources
const memoryConstraint = Math.floor(mem.available / (512 * 1024 * 1024)); // 512MB per worker
const cpuConstraint = Math.max(1, Math.floor(cpuCount * (1 - load.currentLoad / 100)));
return Math.min(memoryConstraint, cpuConstraint, cpuCount);
}
```
## 🔧 Advanced Features
### Cross-Platform Compatibility
`@push.rocks/smartsystem` works seamlessly across different operating systems:
```typescript
const mySystem = new Smartsystem();
const osInfo = await mySystem.information.osInfo();
const platform = osInfo.platform; // 'linux', 'darwin', 'win32', etc.
// Platform-specific logic
if (platform === 'linux') {
// Linux-specific operations
} else if (platform === 'darwin') {
// macOS-specific operations
} else if (platform === 'win32') {
// Windows-specific operations
}
```
### Docker & Container Detection
Detect if your application is running in a containerized environment:
```typescript
const mySystem = new Smartsystem();
const virt = await mySystem.information.dockerInfo();
if (virt.dockerContainers && virt.dockerContainers.length > 0) {
console.log('🐳 Running in Docker');
}
```
## 🛠️ TypeScript Support
Full TypeScript support with comprehensive type definitions:
```typescript
import { Smartsystem } from '@push.rocks/smartsystem';
import type { Systeminformation } from 'systeminformation';
const mySystem = new Smartsystem();
// All methods are fully typed
const cpuInfo: Systeminformation.CpuData = await mySystem.information.cpu();
const memInfo: Systeminformation.MemData = await mySystem.information.mem();
```
## 📚 API Documentation
For complete API documentation, visit: [https://code.foss.global/push.rocks/smartsystem](https://code.foss.global/push.rocks/smartsystem)
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@@ -1,16 +1,16 @@
import { tap, expect } from '@pushrocks/tapbundle'; import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as smartsystem from '../ts/index'; import * as smartsystem from '../ts/index.js';
import { systeminformation } from '../ts/smartsystem.plugins'; import { systeminformation } from '../ts/smartsystem.plugins.js';
let smartsystemInstance: smartsystem.Smartsystem; let smartsystemInstance: smartsystem.Smartsystem;
tap.test('should create a smartsystem instance', async (tools) => { tap.test('should create a smartsystem instance', async (tools) => {
smartsystemInstance = new smartsystem.Smartsystem(); smartsystemInstance = new smartsystem.Smartsystem();
expect(smartsystemInstance).to.be.instanceOf(smartsystem.Smartsystem); expect(smartsystemInstance).toBeInstanceOf(smartsystem.Smartsystem);
}); });
tap.test('should state the operating system', async () => { tap.test('should state the operating system', async () => {
expect(smartsystemInstance.cpus.length).to.be.greaterThan(0); expect(smartsystemInstance.cpus.length).toBeGreaterThan(0);
}); });
tap.test('should get systeminformation', async () => { tap.test('should get systeminformation', async () => {

8
ts/00_commitinfo_data.ts Normal file
View File

@@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartsystem',
version: '3.0.3',
description: 'A TypeScript library for interacting with the system it's running on, including environment, network, and hardware information.'
}

View File

@@ -1,4 +1,4 @@
import * as plugins from './smartsystem.plugins'; import * as plugins from './smartsystem.plugins.js';
export class Smartsystem { export class Smartsystem {
public env = new plugins.smartenv.Smartenv(); public env = new plugins.smartenv.Smartenv();

View File

@@ -3,10 +3,10 @@ import os from 'os';
export { os }; export { os };
import * as lik from '@pushrocks/lik'; import * as lik from '@push.rocks/lik';
import * as smartenv from '@pushrocks/smartenv'; import * as smartenv from '@push.rocks/smartenv';
import * as smartnetwork from '@pushrocks/smartnetwork'; import * as smartnetwork from '@push.rocks/smartnetwork';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@push.rocks/smartpromise';
export { lik, smartenv, smartnetwork, smartpromise }; export { lik, smartenv, smartnetwork, smartpromise };

14
tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

View File

@@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}