Skip to content

Commit

Permalink
feat: add docs about raw method
Browse files Browse the repository at this point in the history
  • Loading branch information
edimitchel committed Jan 9, 2024
1 parent ce2b368 commit 0b25bf7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ Log types are exposed as `consola.[type](...)` and each is a preset of styles an

A list of all available built-in types is [available here](./src/constants.ts).

## Raw output

Objects sent to reporter by logging them could be an issue when using conflicting key (esp. `args`).
To enforce the object to be fully threaded with conflict, you can use the `raw` method chained to any log type.

```js
consola.log({ args: ['foo']});
// returns foo
consola.log.raw({ args: ['foo']});
// returns { args: [ 'foo' ] }
```

## Creating a new instance

Consola has a global instance and is recommended to use everywhere.
Expand Down

0 comments on commit 0b25bf7

Please sign in to comment.