Skip to main content
Home

@std/fmt@1.0.7
Built and signed on GitHub Actions

Utilities for formatting values, such as adding colors to text, formatting durations, printf utils, formatting byte numbers.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 days ago (1.0.7)

bytes

Convert bytes to a human-readable string: 1337 → 1.34 kB

f
format

Convert bytes to a human-readable string: 1337 → 1.34 kB

colors

String formatters and utilities for dealing with ANSI color codes.

f
bgBlack

Set background color to black.

f
bgBlue

Set background color to blue.

f
bgBrightBlack

Set background color to bright black.

f
bgBrightBlue

Set background color to bright blue.

f
bgBrightCyan

Set background color to bright cyan.

f
bgBrightGreen

Set background color to bright green.

f
bgBrightMagenta

Set background color to bright magenta.

f
bgBrightRed

Set background color to bright red.

f
bgBrightWhite

Set background color to bright white.

f
bgBrightYellow

Set background color to bright yellow.

f
bgCyan

Set background color to cyan.

f
bgGreen

Set background color to green.

f
bgMagenta

Set background color to magenta.

f
bgRed

Set background color to red.

f
bgRgb24

Set background color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

f
bgRgb8

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

f
bgWhite

Set background color to white.

f
bgYellow

Set background color to yellow.

f
black

Set text color to black.

f
blue

Set text color to blue.

f
bold

Make the text bold.

f
brightBlack

Set text color to bright black.

f
brightBlue

Set text color to bright blue.

f
brightCyan

Set text color to bright cyan.

f
brightGreen

Set text color to bright green.

f
brightMagenta

Set text color to bright magenta.

f
brightRed

Set text color to bright red.

f
brightWhite

Set text color to bright white.

f
brightYellow

Set text color to bright yellow.

f
cyan

Set text color to cyan.

f
dim

The text emits only a small amount of light.

f
getColorEnabled

Get whether text color change is enabled or disabled.

f
gray

Set text color to gray.

f
green

Set text color to green.

f
hidden

Make the text hidden.

f
inverse

Invert background color and text color.

f
italic

Make the text italic.

f
magenta

Set text color to magenta.

f
red

Set text color to red.

f
reset

Reset the text modified.

I
Rgb

RGB 8-bits per channel. Each in range 0->255 or 0x00->0xff

f
rgb24

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

f
rgb8

Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

f
setColorEnabled

Enable or disable text color when styling.

f
strikethrough

Put horizontal line through the center of the text.

f
stripAnsiCode

Remove ANSI escape codes from the string.

f
underline

Make the text underline.

f
white

Set text color to white.

f
yellow

Set text color to yellow.

duration

Format milliseconds to time duration.

f
format

Format milliseconds to time duration.

I
FormatOptions

Options for format.

printf

sprintf and printf for printing formatted strings to stdout.

f
printf

Converts and format a variable number of args as is specified by format. printf writes the formatted string to standard output.

f
sprintf

Converts and formats a variable number of args as is specified by format. sprintf returns the formatted string.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.