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)
interface FormatOptions

Options for format.

Properties

optional
style:
"narrow"
| "digital"
| "full"
= "narrow"

The style for formatting the duration.

"narrow" for "0d 0h 0m 0s 0ms..." "digital" for "00:00:00:00:000..." "full" for "0 days, 0 hours, 0 minutes,..."

optional
ignoreZero: boolean = false

Whether to ignore zero values. With style="narrow" | "full", all zero values are ignored. With style="digital", only values in the ends are ignored.

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.

Add Package

deno add jsr:@std/fmt

Import symbol

import { type FormatOptions } from "@std/fmt/duration";
or

Import directly with a jsr specifier

import { type FormatOptions } from "jsr:@std/fmt/duration";

Add Package

pnpm i jsr:@std/fmt
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/fmt

Import symbol

import { type FormatOptions } from "@std/fmt/duration";

Add Package

yarn add jsr:@std/fmt
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/fmt

Import symbol

import { type FormatOptions } from "@std/fmt/duration";

Add Package

npx jsr add @std/fmt

Import symbol

import { type FormatOptions } from "@std/fmt/duration";

Add Package

bunx jsr add @std/fmt

Import symbol

import { type FormatOptions } from "@std/fmt/duration";