# bun-style

> Type-safe wrapper around `ansi-styles`, similar to `chalk`.

Latest version **0.3.2** (published 2024-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install bun-style
pnpm add bun-style
yarn add bun-style
bun add bun-style
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2024-08-12 |
| First published | 2022-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 105 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | ctjlewis |

## Links

- npm: https://www.npmjs.com/package/bun-style
- Repository: https://github.com/ctjlewis/bun-style
- Homepage: https://github.com/ctjlewis/bun-style#readme
- Issues: https://github.com/ctjlewis/bun-style/issues
- npm.io page: https://npm.io/package/bun-style

## Dependencies (1)

- [ansi-styles](https://npm.io/package/ansi-styles.md) ^6.1.0

## Recent versions

- 0.3.2 (latest) — 2024-08-12
- 0.3.1 — 2024-08-12
- 0.3.0 — 2022-08-25
- 0.2.0 — 2022-08-25
- 0.1.7 — 2022-08-24
- 0.1.6 — 2022-08-24
- 0.1.5 — 2022-08-24
- 0.1.4 — 2022-08-24
- 0.1.3 — 2022-08-24
- 0.1.2 — 2022-08-24
- 0.1.1 — 2022-08-24
- 0.1.0 — 2022-08-24
- 0.0.4 — 2022-08-24
- 0.0.3 — 2022-08-24

## README

# Console styles for Bun

Type-safe wrapper around `ansi-styles`, similar to `chalk`.

### Example

You can provide a single style as a string, or multiple as an array of strings
to avoid callback hell common with chalk.

```ts
import { style } from "bun-style";

console.log(style("Hello world!", ["green", "bold"]))
```

Also includes a `styleLog()` utility, which adds sensible spacing by default:

```ts
import { styleLog } from "bun-style";

console.log("");
styleLog("Styles testing! ", ["white", "bold"])
styleLog("Running tests...", ["bold", "underline", "grey"])
styleLog("✓ 10 tests passed", ["green"])

/**
 * Equivalent to:
 */
// console.log(
//   "\n\n ",
//   style("Running tests... ", ["bold", "underline", "grey"]),
//   "\n\n ",
//   style("✓ 10 tests passed", ["green"]),
//   "\n\n",
// );
```

![](/assets/example.png)

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