# suf-log

> [![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/mast

Latest version **2.5.3** (published 2020-11-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install suf-log
pnpm add suf-log
yarn add suf-log
bun add suf-log
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.3 |
| Published | 2020-11-10 |
| First published | 2020-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Syler |
| Maintainers | the_real_syler |
| Keywords | logger |

## Links

- npm: https://www.npmjs.com/package/suf-log
- Repository: https://github.com/TheRealSyler/suf-log
- Homepage: https://github.com/TheRealSyler/suf-log#readme
- Issues: https://github.com/TheRealSyler/suf-log/issues
- npm.io page: https://npm.io/package/suf-log

## Dependencies (1)

- [s.color](https://npm.io/package/s.color.md) 0.0.15

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.5.3 (latest) — 2020-11-10
- 2.5.2 — 2020-11-08
- 2.5.1 — 2020-11-08
- 2.5.0 — 2020-11-07
- 2.4.0 — 2020-11-07
- 2.3.0 — 2020-11-06
- 2.2.1 — 2020-11-06
- 2.2.0 — 2020-11-05

## README

## suf-log

Logging utility, some parts are experimental, if you are not me don't use this package.

<span id="BADGE_GENERATION_MARKER_0"></span>
[![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)
<span id="BADGE_GENERATION_MARKER_1"></span>

<span id="DOC_GENERATION_MARKER_0"></span>

# Docs

- **[interfaces](#interfaces)**

  - [LogStyle](#logstyle)
  - [LogMessage](#logmessage)
  - [LogTableInput](#logtableinput)

- **[loggers](#loggers)**

  - [LogS](#logs)
  - [LogSingle](#logsingle)

- **[styler](#styler)**

  - [styler](#styler)

### interfaces

##### LogStyle

```typescript
/**
 * color/background/font-weight work in node and the browser, the other properties only work in the browser.
 */
type LogStyle = string | {
    /**node and browser support */
    background?: string;
    /**node and browser support */
    color?: string;
    /**browser only */
    padding?: string;
    /**browser only */
    margin?: string;
    /**browser only, set to inline-block by default. */
    display?: string;
    /**browser only */
    border?: string;
    /**browser only */
    'border-radius'?: string;
    /**browser only */
    'text-align'?: string;
    /**browser only */
    'text-shadow'?: string;
    /**browser only */
    'font-size'?: string;
    /** for bold text in node add the value 'bold' */
    'font-weight'?: 'bold' | 'normal' | 'bolder' | 'lighter' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
    [key: string]: string | undefined;
}
```

##### LogMessage

```typescript
type LogMessage = {
    message: string;
    style?: LogStyle;
}
```

##### LogTableInput

```typescript
type LogTableInput = (number | string | LogMessage)[][];
```

### loggers

##### LogS

```typescript
/**works in node and the browser.*/
function Log(...messages: (string | LogMessage)[]): void;
interface LogTableOptions {
    padding?: number;
    spacing?: number;
}
/**node only*/
function LogTable(table: LogTableInput, options?: LogTableOptions): void;
/**works in the browser and node. */
function LogS(styles: LogStyle[], ...messages: string[]): void;
```

##### LogSingle

```typescript
/**Log a single message with an optional style, works in the browser and node. */
function LogSingle(message: string, style?: LogStyle): void;
```

### styler

##### styler

```typescript
/**
 * this function is not browser compatible*.
 * @example ```ts
 * console.log(styler('test', 'red'))
 * ```
 *
 * *you have to add the styles manually, use the Log function for browser compatibly.
 */
function styler(input: string, style?: LogStyle): string;
```

_Generated with_ **[suf-cli](https://www.npmjs.com/package/suf-cli)**
<span id="DOC_GENERATION_MARKER_1"></span>

### License

<span id="LICENSE_GENERATION_MARKER_0"></span>
Copyright (c) 2020 Leonard Grosoli Licensed under the MIT license.
<span id="LICENSE_GENERATION_MARKER_1"></span>

---
_Source: https://npm.io/package/suf-log · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
