update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 13:34:25 +02:00
parent 9c690bce64
commit d443a51c97
4 changed files with 108 additions and 38 deletions

View File

@ -11,12 +11,23 @@
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "consolecolor",
"description": "a simple module to deal with console colors",
"description": "A module for applying color styles to console output.",
"npmPackagename": "@push.rocks/consolecolor",
"license": "MIT"
"license": "MIT",
"keywords": [
"console log styling",
"ANSI colors",
"terminal colors",
"command line utilities",
"node.js",
"typescript",
"text formatting",
"log enhancement",
"development tools"
]
}
},
"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/consolecolor",
"version": "2.0.2",
"private": false,
"description": "colors for beautylog",
"description": "A module for applying color styles to console output.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"scripts": {
@ -15,10 +15,15 @@
"url": "git+https://gitlab.com/push.rocks/consolecolor.git"
},
"keywords": [
"color",
"terminal",
"beautylog",
"push.rocks"
"console log styling",
"ANSI colors",
"terminal colors",
"command line utilities",
"node.js",
"typescript",
"text formatting",
"log enhancement",
"development tools"
],
"author": "Lossless GmbH",
"license": "MIT",
@ -52,4 +57,4 @@
"npmextra.json",
"readme.md"
]
}
}

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

111
readme.md
View File

@ -1,45 +1,98 @@
# consolecolor
# @push.rocks/consolecolor
colors for beautylog
## Availabililty
## Install
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/consolecolor)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/consolecolor)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/consolecolor)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/consolecolor/)
To install `@push.rocks/consolecolor`, you need Node.js installed on your system. If you have Node.js installed, you can add `@push.rocks/consolecolor` to your project by running:
## Status for master
```bash
npm install @push.rocks/consolecolor --save
```
[![build status](https://GitLab.com/pushrocks/consolecolor/badges/master/build.svg)](https://GitLab.com/pushrocks/consolecolor/commits/master)
[![coverage report](https://GitLab.com/pushrocks/consolecolor/badges/master/coverage.svg)](https://GitLab.com/pushrocks/consolecolor/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/consolecolor.svg)](https://www.npmjs.com/package/consolecolor)
[![Dependency Status](https://david-dm.org/pushrocks/consolecolor.svg)](https://david-dm.org/pushrocks/consolecolor)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/consolecolor/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/consolecolor/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/consolecolor/badges/code.svg)](https://www.bithound.io/github/pushrocks/consolecolor)
[![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/)
This command will install `@push.rocks/consolecolor` and add it to your project's `package.json` file.
## Usage
Use TypeScript for best in class instellisense.
In this guide, we'll explore how to use `@push.rocks/consolecolor` to colorize your console output in a Node.js application. We'll cover the basics, including coloring text, backgrounds, and combining both for striking effects. This package utilizes TypeScript and ESM syntax for modern, type-safe code examples.
```javascript
import * as consolecolor from 'consolecolor';
### Getting Started
let myColoredString = consolecolor.coloredString(
'This string has a blue font and a green background',
'blue',
'green'
);
First, ensure you have imported the library in your TypeScript file:
console.log(myColoredString);
```typescript
import * as consolecolor from '@push.rocks/consolecolor';
```
For further information read the linked docs at the top of this README.
### Coloring Text
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
The foundation of using `@push.rocks/consolecolor` is to change the color of the text output. You can choose from a variety of colors including blue, red, green, and more. Here's how to color a string blue:
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
```typescript
let blueString = consolecolor.coloredString("This text is blue.", "blue");
console.log(blueString);
```
### Adding Background Color
In addition to coloring text, you can also set the background color of your text for greater emphasis:
```typescript
let redTextOnGreen = consolecolor.coloredString("Red text on a green background.", "red", "green");
console.log(redTextOnGreen);
```
### Combining Colors
You can easily mix and match text and background colors to suit your needs. Here's an example of a more detailed usage, where we add a function to create and log messages of different severities with appropriate coloring:
```typescript
function logMessage(message: string, type: 'info' | 'warning' | 'error') {
switch (type) {
case 'info':
console.log(consolecolor.coloredString(message, 'cyan'));
break;
case 'warning':
console.log(consolecolor.coloredString(message, 'orange', 'black'));
break;
case 'error':
console.log(consolecolor.coloredString(message, 'red', 'white'));
break;
}
}
logMessage('An informational message', 'info');
logMessage('A warning message', 'warning');
logMessage('An error message', 'error');
```
This example defines a `logMessage` function that accepts a message and a message type. It uses `@push.rocks/consolecolor` to color the message according to its severity.
### Advanced Usage
Beyond basic coloring, `@push.rocks/consolecolor` allows for intricate customization. For instance, you can create utilities that dynamically select colors based on conditions, enhance logging mechanisms, or implement theme-based console outputs in your Node.js applications.
Considering the capabilities of `@push.rocks/consolecolor` alongside Node.js's console object, you can create highly readable, colorful console applications that are easier to debug and pleasant to interact with.
### Conclusion
`@push.rocks/consolecolor` offers a simple yet powerful API for adding color to Node.js console applications. By following the examples provided, you can enhance the visual appeal and readability of your console output, making development and debugging a more enjoyable experience. For a comprehensive list of all available colors and more advanced features, refer to the official documentation and explore the module's possibilities.
## 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.