--- title: "@std/fmt" description: "Utilities for formatting values, such as adding colors to text, formatting durations, printf utils, formatting byte numbers." jsr: jsr:@std/fmt pkg: fmt version: 1.0.9 generated: true stability: stable --- ## Overview
Provides utilities for formatting text of different types:
```js import { format } from "@std/fmt/bytes"; import { red } from "@std/fmt/colors"; console.log(red(format(1337))); // Prints "1.34 kB" ```bytes,
colors, and
duration supports all major runtimes.
printf is mostly compatible with major
runtimes, however some of features, such as %v, %i and %I format
specifiers, are only available in Deno. See the API docs for details.