update tsconfig
This commit is contained in:
parent
9c690bce64
commit
d443a51c97
@ -11,12 +11,23 @@
|
|||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "consolecolor",
|
"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",
|
"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"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
15
package.json
15
package.json
@ -2,7 +2,7 @@
|
|||||||
"name": "@push.rocks/consolecolor",
|
"name": "@push.rocks/consolecolor",
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "colors for beautylog",
|
"description": "A module for applying color styles to console output.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -15,10 +15,15 @@
|
|||||||
"url": "git+https://gitlab.com/push.rocks/consolecolor.git"
|
"url": "git+https://gitlab.com/push.rocks/consolecolor.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"color",
|
"console log styling",
|
||||||
"terminal",
|
"ANSI colors",
|
||||||
"beautylog",
|
"terminal colors",
|
||||||
"push.rocks"
|
"command line utilities",
|
||||||
|
"node.js",
|
||||||
|
"typescript",
|
||||||
|
"text formatting",
|
||||||
|
"log enhancement",
|
||||||
|
"development tools"
|
||||||
],
|
],
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
111
readme.md
111
readme.md
@ -1,45 +1,98 @@
|
|||||||
# consolecolor
|
# @push.rocks/consolecolor
|
||||||
|
|
||||||
colors for beautylog
|
colors for beautylog
|
||||||
|
|
||||||
## Availabililty
|
## Install
|
||||||
|
|
||||||
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/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:
|
||||||
[![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/)
|
|
||||||
|
|
||||||
## 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)
|
This command will install `@push.rocks/consolecolor` and add it to your project's `package.json` file.
|
||||||
[![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/)
|
|
||||||
|
|
||||||
## Usage
|
## 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
|
### Getting Started
|
||||||
import * as consolecolor from 'consolecolor';
|
|
||||||
|
|
||||||
let myColoredString = consolecolor.coloredString(
|
First, ensure you have imported the library in your TypeScript file:
|
||||||
'This string has a blue font and a green background',
|
|
||||||
'blue',
|
|
||||||
'green'
|
|
||||||
);
|
|
||||||
|
|
||||||
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)
|
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:
|
||||||
> | 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)
|
```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.
|
||||||
|
Loading…
Reference in New Issue
Block a user