update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 18:27:46 +02:00
parent 89d9692701
commit 8b101369b8
4 changed files with 139 additions and 33 deletions

View File

@ -9,12 +9,23 @@
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartsystem",
"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.",
"npmPackagename": "@push.rocks/smartsystem",
"license": "MIT"
"license": "MIT",
"keywords": [
"TypeScript",
"system information",
"environment variables",
"network",
"hardware info",
"OS interaction",
"module loading",
"async",
"cross-platform"
]
}
},
"tsdocs": {
"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"
}
}

View File

@ -1,7 +1,7 @@
{
"name": "@push.rocks/smartsystem",
"version": "3.0.1",
"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",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -16,8 +16,14 @@
},
"keywords": [
"TypeScript",
"lazy",
"module loader"
"system information",
"environment variables",
"network",
"hardware info",
"OS interaction",
"module loading",
"async",
"cross-platform"
],
"author": "Lossless GmbH",
"license": "MIT",

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

142
readme.md
View File

@ -1,39 +1,127 @@
# @pushrocks/smartsystem
# @push.rocks/smartsystem
interact with the system you are running on
## Availabililty and Links
* [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/)
## Install
## Status for master
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:
Status Category | Status Badge
-- | --
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)
```bash
npm install @push.rocks/smartsystem --save
```
This command will download @push.rocks/smartsystem and add it to your project's `package.json` file as a dependency.
## Usage
We recommend the use of TypeScript for best Intellisense
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.
## Contribution
### Getting Started
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). :)
First, ensure that you are importing the module correctly in your TypeScript file:
For further information read the linked docs at the top of this readme.
```typescript
import { Smartsystem } from '@push.rocks/smartsystem';
```
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
### Creating an Instance of Smartsystem
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
To use the functionalities provided by `@push.rocks/smartsystem`, you need to create a new instance of the `Smartsystem` class.
```typescript
const mySystem = new Smartsystem();
```
### Accessing Environment Variables
`@push.rocks/smartsystem` integrates with `@pushrocks/smartenv` to provide an easy way to handle environment variables.
```typescript
console.log(mySystem.env.getEnvVars());
```
### Getting CPU Information
You can retrieve information about the CPUs of the system:
```typescript
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`:
```typescript
(async () => {
console.log(await mySystem.network.getNetworkInfo());
})();
```
### System Information
For more detailed system information such as hardware specs or software versions, `@push.rocks/smartsystem` relies on the `systeminformation` library:
```typescript
(async () => {
console.log(await mySystem.information.system());
// Output detailed information about the system like manufacturer, model, etc.
console.log(await mySystem.information.osInfo());
// Output detailed information about the operating system
})();
```
### Real-World Scenarios
Now that we've covered the basics let's dive into some real-world applications:
#### Monitoring System Load
You can monitor the current load on the system to make decisions or trigger actions when the system is under heavy use:
```typescript
(async () => {
const systemLoad = await mySystem.information.currentLoad();
if (systemLoad.currentLoad > 80) {
console.log("High system load detected. Consider scaling or optimizing your applications.");
}
})();
```
#### Network Monitoring
It's often useful to keep an eye on network interfaces, especially when diagnosing connectivity issues or monitoring network traffic:
```typescript
(async () => {
const defaultInterface = await mySystem.information.networkInterfaceDefault();
const interfaceStats = await mySystem.information.networkStats(defaultInterface);
console.log(interfaceStats);
// Use this information to alert on unusual traffic patterns or drops in speed.
})();
```
### Conclusion
`@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.
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/).
## 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.