update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 13:39:10 +02:00
parent 2a68c9ad90
commit b64fe567a8
4 changed files with 218 additions and 39 deletions

View File

@ -9,12 +9,25 @@
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "lik",
"description": "light little helpers for node",
"description": "Provides a collection of lightweight helpers and utilities for Node.js projects.",
"npmPackagename": "@push.rocks/lik",
"license": "MIT"
"license": "MIT",
"keywords": [
"Utilities",
"Helpers",
"Typescript",
"Node.js",
"String manipulation",
"Object management",
"Execution control",
"Data structures",
"Asynchronous programming",
"Event handling",
"Data aggregation"
]
}
},
"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

@ -2,7 +2,7 @@
"name": "@push.rocks/lik",
"version": "6.0.14",
"private": false,
"description": "light little helpers for node",
"description": "Provides a collection of lightweight helpers and utilities for Node.js projects.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -53,5 +53,18 @@
],
"browserslist": [
"last 1 chrome versions"
],
"keywords": [
"Utilities",
"Helpers",
"Typescript",
"Node.js",
"String manipulation",
"Object management",
"Execution control",
"Data structures",
"Asynchronous programming",
"Event handling",
"Data aggregation"
]
}

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

220
readme.md
View File

@ -1,52 +1,204 @@
# @push.rocks/lik
light little helpers for node
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/lik)
* [gitlab.com (source)](https://gitlab.com/push.rocks/lik)
* [github.com (source mirror)](https://github.com/push.rocks/lik)
* [docs (typedoc)](https://push.rocks.gitlab.io/lik/)
## Install
## Status for master
To install `@push.rocks/lik`, you can use npm (Node Package Manager). Simply run the following command in your terminal:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/lik/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/lik/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/lik)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/lik)](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/@push.rocks/lik)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/lik)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/lik)](https://lossless.cloud)
```bash
npm install @push.rocks/lik --save
```
This will download `@push.rocks/lik` and add it to your project's `package.json` dependencies.
## Usage
Use TypeScript for best in class instellisense.
`@push.rocks/lik` is a versatile package offering a variety of helper classes designed to simplify common tasks in Node.js development. From managing asynchronous operations to handling collections efficiently, this library provides lightweight solutions to enhance your coding workflow. Below, we explore several key features of `@push.rocks/lik`, presenting TypeScript examples to demonstrate their practical application in real-world scenarios.
```javascript
// import any tool that you need from lik
import { Stringmap, Objectmap, Observablemap } from 'lik';
### AsyncExecutionStack
`AsyncExecutionStack` allows for managing asynchronous task execution with exclusive and non-exclusive slots, ensuring effective handling of resource-intensive operations.
```typescript
import { AsyncExecutionStack } from '@push.rocks/lik';
const myAsyncStack = new AsyncExecutionStack();
// Exclusive execution ensures this task doesn't run in parallel with others
await myAsyncStack.getExclusiveExecutionSlot(async () => {
// some asynchronous operation
}, 2500);
// Non-exclusive slots can run in parallel
myAsyncStack.getNonExclusiveExecutionSlot(async () => {
// another asynchronous operation
}, 1500);
```
### class Stringmap
### FastMap
Stringmap allows you to keep track of strings. It allows you to register triggers for certain events
like when a certain string is removed or added to the map
`FastMap` offers a high-performance, key-value map optimized for rapid access and modifications, ideal for scenarios requiring frequent read/write operations.
### class Objectmap
```typescript
import { FastMap } from '@push.rocks/lik';
Sometimes you need to keep track of objects, but implementing logic for removing, finding or updating is tedious.
Objectmap takes care of keeping track of objects for you.
const myFastMap = new FastMap<string>();
## Contribution
// Add items
myFastMap.addToMap('key1', 'value1');
myFastMap.addToMap('key2', 'value2');
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). :)
// Retrieve item
const value = myFastMap.getByKey('key1'); // 'value1'
```
For further information read the linked docs at the top of this readme.
### LimitedArray
## Legal
> MIT licensed | **&copy;** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
`LimitedArray` enforces a maximum size on an array, automatically managing its length to prevent it from exceeding a defined limit.
```typescript
import { LimitedArray } from '@push.rocks/lik';
const myLimitedArray = new LimitedArray<number>(5); // limit size to 5
myLimitedArray.addMany([1, 2, 3, 4, 5, 6]);
console.log(myLimitedArray.array); // [2, 3, 4, 5, 6]
```
### LoopTracker
`LoopTracker` helps detect and prevent infinite loops by tracking object references during iterations.
```typescript
import { LoopTracker } from '@push.rocks/lik';
const myLoopTracker = new LoopTracker<object>();
const obj1 = {};
if (myLoopTracker.checkAndTrack(obj1)) {
// proceed with operation
} else {
// potential loop detected
}
```
### ObjectMap
`ObjectMap` facilitates object management, providing functionalities for adding, finding, and removing objects with ease.
```typescript
import { ObjectMap } from '@push.rocks/lik';
interface MyObject {
id: number;
name: string;
}
const myObjectMap = new ObjectMap<MyObject>();
const obj: MyObject = { id: 1, name: 'Test Object' };
// Add object
myObjectMap.add(obj);
// Find object
const found = myObjectMap.findSync(item => item.id === 1);
```
### StringMap
`StringMap` simplifies string collection management, allowing you to add, remove, and query strings effectively.
```typescript
import { Stringmap } from '@push.rocks/lik';
const myStringMap = new Stringmap();
// Add strings
myStringMap.addString('hello');
myStringMap.addStringArray(['world', 'example']);
// Check string presence
const exists = myStringMap.checkString('hello'); // true
```
### TimedAggregator
`TimedAggregator` batches operations over a specified time interval, useful for aggregating logs, metrics, or any data points over time.
```typescript
import { TimedAggregtor } from '@push.rocks/lik';
const myAggregator = new TimedAggregtor<string>({
aggregationIntervalInMillis: 5000, // 5 seconds
functionForAggregation: (items) => {
console.log('Aggregated items:', items);
}
});
// Add items
myAggregator.add('item1');
myAggregator.add('item2');
// After 5 seconds, the functionForAggregation will log the aggregated items
```
### InterestMap and Tree
`InterestMap` provides a structure for managing subscriptions or interests in certain events or entities, optimizing notification mechanisms.
```typescript
import { InterestMap } from '@push.rocks/lik';
const myInterestMap = new InterestMap<string, number>((str) => str);
myInterestMap.addInterest('event1').then((interest) => {
interest.fullfillInterest(42);
});
```
`Tree` offers a way to handle hierarchical data structures, allowing for the composition and traversal of tree-like data sets.
```typescript
import { Tree } from '@push.rocks/lik';
class TreeNode {
constructor(public value: string) {}
}
const myTree = new Tree<TreeNode>();
const rootNode = new TreeNode('root');
myTree.initialize(rootNode);
// Add child nodes
const childNode = new TreeNode('child');
myTree.appendChild(rootNode, childNode);
```
### Utilizing @push.rocks/lik in Your Project
With `@push.rocks/lik`, you gain access to a comprehensive set of lightweight utilities that can significantly simplify and expedite the development process in Node.js environments. By leveraging the library's classes and functions, you can implement efficient data structures, manage asynchronous operations gracefully, and streamline complex logic with ease.
By integrating `@push.rocks/lik` into your project, you'll benefit from improved code clarity, reduced boilerplate, and enhanced performance, allowing you to focus on developing the core functionalities of your application. Whether you're managing various collections, executing asynchronous tasks in controlled manners, or dealing with hierarchical data, `@push.rocks/lik` provides the tools you need to achieve your objectives with minimal overhead.
Remember, continuous exploration of `@push.rocks/lik`'s capabilities and experimenting with its various components in different scenarios will help you unlock its full potential. As your familiarity with the library grows, you'll discover even more ways to optimize your codebase and streamline your development workflow.
## 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.