Skip to main content

@std/fmt@1.0.6
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
2 months ago (1.0.6)

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.

function setColorEnabled
setColorEnabled(value: boolean): void

Enable or disable text color when styling.

@std/fmt/colors automatically detects NO_COLOR environmental variable and disables text color. Use this API only when the automatic detection doesn't work.

Examples

Usage

import { setColorEnabled } from "@std/fmt/colors";

// Disable text color
setColorEnabled(false);

// Enable text color
setColorEnabled(true);

Parameters

value: boolean

The boolean value to enable or disable text color

Return Type

void

Add Package

deno add jsr:@std/fmt

Import symbol

import { setColorEnabled } from "@std/fmt/colors";

---- OR ----

Import directly with a jsr specifier

import { setColorEnabled } from "jsr:@std/fmt/colors";

Add Package

npx jsr add @std/fmt

Import symbol

import { setColorEnabled } from "@std/fmt/colors";

Add Package

yarn dlx jsr add @std/fmt

Import symbol

import { setColorEnabled } from "@std/fmt/colors";

Add Package

pnpm dlx jsr add @std/fmt

Import symbol

import { setColorEnabled } from "@std/fmt/colors";

Add Package

bunx jsr add @std/fmt

Import symbol

import { setColorEnabled } from "@std/fmt/colors";