-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ansi colors and cursor control functions
- Loading branch information
Showing
5 changed files
with
364 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{ | ||
"name": "@cross/utils", | ||
"version": "0.0.2", | ||
"version": "0.1.3", | ||
"exports": "./mod.ts", | ||
"imports": { "@cross/runtime": "jsr:@cross/runtime@^0.0.16" } | ||
"imports": { | ||
"@cross/runtime": "jsr:@cross/runtime@^0.0.16", | ||
"@cross/test": "jsr:@cross/test@^0.0.8", | ||
"@std/assert": "jsr:@std/assert@^0.219.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { test } from "@cross/test"; | ||
import { assertEquals } from "@std/assert"; | ||
|
||
import { stripAnsi } from "./ansi.ts"; | ||
|
||
test("Strip ansi characters", () => { | ||
const text = "\x1b[31mThis is colored\x1b[0m and \x1b[2J\x1b[1;20Hsome more text"; | ||
const strippedText = stripAnsi(text); | ||
assertEquals(strippedText, "This is colored and some more text"); | ||
}); |
Oops, something went wrong.