toConstantCase

import { toConstantCase } from "jsr:@ende/text/unstable-to-constant-case";

function ยท experimental

function toConstantCase(input: string): string

Converts a string into CONSTANT_CASE (also known as SCREAMING_SNAKE_CASE).

input: string

The string that is going to be converted into CONSTANT_CASE

Returns

The string as CONSTANT_CASE

Example: Usage

import { toConstantCase } from "@ende/text/unstable-to-constant-case";
import { assertEquals } from "@ende/assert/equals";

assertEquals(toConstantCase("deno is awesome"), "DENO_IS_AWESOME");

Source