bun-style
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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.

import { style } from "bun-style";

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

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

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",
// );

Readme

Keywords

none

Package Sidebar

Install

npm i bun-style

Weekly Downloads

17

Version

0.3.0

License

MIT

Unpacked Size

157 kB

Total Files

10

Last publish

Collaborators

  • ctjlewis