Skip to content

Commit f50c42c

Browse files
authored
docs(fmt): clarify runtime compatiblity (#6648)
1 parent 66cafd9 commit f50c42c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

fmt/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ import { red } from "@std/fmt/colors";
1111

1212
console.log(red(format(1337))); // Prints "1.34 kB"
1313
```
14+
15+
# Runtime compatibility
16+
17+
[bytes](https://jsr.io/@std/fmt/doc/bytes/~),
18+
[colors](https://jsr.io/@std/fmt/doc/colors/~), and
19+
[duration](https://jsr.io/@std/fmt/doc/duration/~) supports all major runtimes.
20+
[printf](https://jsr.io/@std/fmt/doc/printf/~) is mostly compatible with major
21+
runtimes, however some of features, such as `%v`, `%i` and `%I` format
22+
specifiers, are only available in Deno. See the API docs for details.

fmt/printf.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,9 @@ class Printf {
954954
*
955955
* See the module documentation for the available format strings.
956956
*
957+
* `%v`, `%i`, and `%` are only supported in Deno runtime. Other formats are supported in
958+
* other major runtimes.
959+
*
957960
* @example Usage
958961
* ```ts
959962
* import { sprintf } from "@std/fmt/printf";
@@ -983,6 +986,8 @@ export function sprintf(format: string, ...args: unknown[]): string {
983986
*
984987
* See the module documentation for the available format strings.
985988
*
989+
* This API only supports Deno runtime.
990+
*
986991
* @example Usage
987992
* ```ts no-assert
988993
* import { printf } from "@std/fmt/printf";

0 commit comments

Comments
 (0)