# standard-log-console

> Console writer for `standard-log`

Latest version **1.3.6** (published 2019-07-15) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install standard-log-console
pnpm add standard-log-console
yarn add standard-log-console
bun add standard-log-console
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.3.6 |
| Published | 2019-07-15 |
| First published | 2019-02-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 120 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Homa Wong |
| Maintainers | unional |

## Links

- npm: https://www.npmjs.com/package/standard-log-console
- Repository: https://github.com/unional/standard-log
- Issues: https://github.com/unional/standard-log/issues
- npm.io page: https://npm.io/package/standard-log-console

## Dependencies (5)

- [ms](https://npm.io/package/ms.md) ^2.1.2
- [is-node](https://npm.io/package/is-node.md) ^1.0.2
- [color-map](https://npm.io/package/color-map.md) ^1.1.0
- [type-plus](https://npm.io/package/type-plus.md) ^1.26.2
- [standard-log-core](https://npm.io/package/standard-log-core.md) ^1.5.0

## Recent versions

- 1.3.6 (latest) — 2019-07-15
- 1.3.5 — 2019-07-15
- 1.3.4 — 2019-07-15
- 1.3.3 — 2019-07-15
- 1.3.2 — 2019-07-15
- 1.3.0 — 2019-07-14
- 1.2.2 — 2019-07-14
- 1.2.0 — 2019-07-14
- 1.1.0 — 2019-02-11

## README

# standard-log-console

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]

[![Circle CI][circleci-image]][circleci-url]
[![Travis CI][travis-image]][travis-url]
[![Codecov][codecov-image]][codecov-url]
[![Coveralls Status][coveralls-image]][coveralls-url]

Console support for [`standard-log`](https://github.com/unional/standard-log).

This is the default reporter of [`standard-log`](https://github.com/unional/standard-log).

## Installation

In normal use case you don't need to reference this library directly.

[`standard-log`](https://github.com/unional/standard-log) exports the main features from `standard-log-console`.

```sh
yarn add standard-log
```

If you want to access other features from `stand-log-console`, you can install it directly:

```sh
yarn add standard-log-console
```

## Usage

By default, [`standard-log`](https://github.com/unional/standard-log) will use this reporter by default.

If you want to configure `standard-log` to use other reporters programatically,
you can use the `createConsoleLogReporter()` to create the reporter for console:

```ts
import {
  createConsoleLogReporter,
  config, // by `standard-log`
} from 'standard-log'

config({ reporters: [createConsoleLogReporter(), /* other reporters */] })
```

By default, it will use ansi formatter in NodeJS and css formatter in browser.

If you want to change that, or use your own formatter:

```ts
import { createConsoleLogReporter } from 'standard-log'

createConsoleLogReporter({
  formatter: yourFormatter
})
```

For `createCssFormatter()`, you can specify how many colors to use:

```ts
import { createCssFormatter } from 'standard-log'

createCssFormatter({ maxColor: 30 })
```
![](2019-07-13-17-19-12.png)

You can also configure the `timestamp` format:

```ts
import { createAnsiFormatter, createCssFormatter } from 'standard-log'

createAnsiFormatter({ timestamp: 'none' })
createAnsiFormatter({ timestamp: 'iso' })
createAnsiFormatter({ timestamp: 'elasped' })

createCssFormatter({ timestamp: 'none' })
createCssFormatter({ timestamp: 'iso' })
createCssFormatter({ timestamp: 'elasped' })
```

![](2019-07-13-17-18-14.png)

[circleci-image]: https://circleci.com/gh/unional/standard-log/tree/master.svg?style=shield
[circleci-url]: https://circleci.com/gh/unional/standard-log/tree/master
[codecov-image]: https://codecov.io/gh/unional/standard-log/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/unional/standard-log
[coveralls-image]: https://coveralls.io/repos/github/unional/standard-log/badge.svg
[coveralls-url]: https://coveralls.io/github/unional/standard-log
[downloads-image]: https://img.shields.io/npm/dm/standard-log-console.svg?style=flat
[downloads-url]: https://npmjs.org/package/standard-log-console
[npm-image]: https://img.shields.io/npm/v/standard-log-console.svg?style=flat
[npm-url]: https://www.npmjs.com/package/standard-log-console
[travis-image]: https://travis-ci.com/unional/standard-log.svg?branch=master
[travis-url]: https://travis-ci.com/unional/standard-log?branch=master

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