std/fmt
Ian Bull 3b3a7617ab
refactor(assert,datetime,fmt,io,streams): consistently throw new Error() instead of throw Error() (#5855)
refactor(assert, datetime, fmt, io, streams): use `throw new Error` instead of `throw`

To ensure consistency across the codebase, this commit refactors the
codebase to use `throw new Error` instead of `throw` for throwing
errors.

https://github.com/denoland/std/issues/5854
2024-08-29 08:55:24 +10:00
..
bytes_test.ts chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
bytes.ts docs(cli,csv,datetime,fmt,fs,http,ini,semver,testing): assert optional properties on types/interfaces have @default tag (#4933) 2024-07-11 09:21:37 +00:00
colors_test.ts chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
colors.ts docs(fmt,fs,text,yaml): fix Markdown alerts (#5568) 2024-07-29 21:31:14 +10:00
deno.json chore: release 2024.08.26 (#5824) 2024-08-26 17:33:29 +09:00
duration_test.ts chore: switch to JSR-oriented codebase (#4650) 2024-04-29 11:57:30 +09:00
duration.ts BREAKING(fmt): rename PrettyDurationOptions to FormatOptions (#5591) 2024-07-31 19:23:43 +09:00
printf_test.ts refactor(archive,cache,datetime,fmt,front-matter): align error messages to the style guide (#5706) 2024-08-21 14:42:02 +09:00
printf.ts refactor(assert,datetime,fmt,io,streams): consistently throw new Error() instead of throw Error() (#5855) 2024-08-29 08:55:24 +10:00
README.md docs(fmt): improve documentation (#5373) 2024-07-10 15:26:41 +10:00

Provides utilities for formatting text of different types:

import { format } from "@std/fmt/bytes";
import { red } from "@std/fmt/colors";

console.log(red(format(1337))); // Prints "1.34 kB"