1 | ## suf-log
|
2 |
|
3 | <span id="BADGE_GENERATION_MARKER_0"></span>
|
4 | [![circleci](https://img.shields.io/circleci/build/github/TheRealSyler/suf-log)](https://app.circleci.com/github/TheRealSyler/suf-log/pipelines) [![Custom](https://codecov.io/gh/TheRealSyler/suf-log/branch/master/graph/badge.svg)](https://codecov.io/gh/TheRealSyler/suf-log) [![npmV](https://img.shields.io/npm/v/suf-log?color=green)](https://www.npmjs.com/package/suf-log) [![min](https://img.shields.io/bundlephobia/min/suf-log)](https://bundlephobia.com/result?p=suf-log) [![install](https://badgen.net/packagephobia/install/suf-log)](https://packagephobia.now.sh/result?p=suf-log) [![githubLastCommit](https://img.shields.io/github/last-commit/TheRealSyler/suf-log)](https://github.com/TheRealSyler/suf-log)
|
5 | <span id="BADGE_GENERATION_MARKER_1"></span>
|
6 |
|
7 | <span id="DOC_GENERATION_MARKER_0"></span>
|
8 |
|
9 | # Docs
|
10 |
|
11 | - **[interfaces](#interfaces)**
|
12 |
|
13 | - [LogStyle](#logstyle)
|
14 | - [ConverterInput](#converterinput)
|
15 | - [LogMessage](#logmessage)
|
16 | - [LogTable](#logtable)
|
17 |
|
18 | - **[loggers](#loggers)**
|
19 |
|
20 | - [Log](#log)
|
21 | - [LogTableOptions](#logtableoptions)
|
22 | - [LogTable](#logtable)
|
23 |
|
24 | - **[styler](#styler)**
|
25 |
|
26 | - [styler](#styler)
|
27 |
|
28 | ### interfaces
|
29 |
|
30 | ##### LogStyle
|
31 |
|
32 | ```typescript
|
33 | /**
|
34 | * color/background/font-weight work in node and the browser, the other properties only work in the browser.
|
35 | */
|
36 | type LogStyle = string | {
|
37 | background?: string;
|
38 | color?: string;
|
39 | padding?: string;
|
40 | margin?: string;
|
41 | border?: string;
|
42 | /** for bold text in node add the value 'bold' */
|
43 | 'font-weight'?: FontWeightProperty;
|
44 | /** if true the style doesn't get reset in node. */
|
45 | [key: string]: number | boolean | string | undefined;
|
46 | }
|
47 | ```
|
48 |
|
49 | ##### ConverterInput
|
50 |
|
51 | ```typescript
|
52 | type ConverterInput = AcceptableTypes | Array<AcceptableTypes>;
|
53 | ```
|
54 |
|
55 | ##### LogMessage
|
56 |
|
57 | ```typescript
|
58 | type LogMessage = {
|
59 | message: string;
|
60 | style?: LogStyle;
|
61 | }
|
62 | ```
|
63 |
|
64 | ##### LogTable
|
65 |
|
66 | ```typescript
|
67 | type LogTable = (number | string | LogMessage)[][];
|
68 | ```
|
69 |
|
70 | ### loggers
|
71 |
|
72 | ##### Log
|
73 |
|
74 | ```typescript
|
75 | function Log(...messages: (string | LogMessage)[]): void;
|
76 | ```
|
77 |
|
78 | ##### LogTableOptions
|
79 |
|
80 | ```typescript
|
81 | interface LogTableOptions {
|
82 | padding?: number;
|
83 | spacing?: number;
|
84 | }
|
85 | ```
|
86 |
|
87 | ##### LogTable
|
88 |
|
89 | ```typescript
|
90 | function LogTable(table: LogTable, options?: LogTableOptions): void;
|
91 | ```
|
92 |
|
93 | ### styler
|
94 |
|
95 | ##### styler
|
96 |
|
97 | ```typescript
|
98 | /**
|
99 | * this function is not browser compatible*.
|
100 | * @example ```ts
|
101 | * console.log(styler('test', 'red'))
|
102 | * ```
|
103 | *
|
104 | * *you have to add the styles manually, use the Log function for browser compatibly.
|
105 | */
|
106 | function styler(input: string, style?: LogStyle): string;
|
107 | ```
|
108 |
|
109 | _Generated with_ **[suf-cli](https://www.npmjs.com/package/suf-cli)**
|
110 | <span id="DOC_GENERATION_MARKER_1"></span>
|
111 |
|
112 | ### License
|
113 |
|
114 | <span id="LICENSE_GENERATION_MARKER_0"></span>
|
115 | Copyright (c) 2020 Leonard Grosoli Licensed under the MIT license.
|
116 | <span id="LICENSE_GENERATION_MARKER_1"></span>
|