{"id":19560632,"url":"https://github.com/zoubin/ansi-escape","last_synced_at":"2025-09-05T10:32:54.584Z","repository":{"id":74511838,"uuid":"46702669","full_name":"zoubin/ansi-escape","owner":"zoubin","description":"ANSI escape codes for manipulating the terminal","archived":false,"fork":false,"pushed_at":"2016-01-07T09:35:35.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T12:51:43.669Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-23T07:05:45.000Z","updated_at":"2018-03-16T02:49:49.000Z","dependencies_parsed_at":"2023-03-17T07:10:38.704Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/ansi-escape","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/ansi-escape","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fansi-escape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fansi-escape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fansi-escape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fansi-escape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/ansi-escape/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fansi-escape/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273746607,"owners_count":25160646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:08:20.744Z","updated_at":"2025-09-05T10:32:49.556Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansi-escape\nANSI escape codes for manipulating the terminal\n\n[![version](https://img.shields.io/npm/v/ansi-escape.svg)](https://www.npmjs.org/package/ansi-escape)\n[![status](https://travis-ci.org/zoubin/ansi-escape.svg?branch=master)](https://travis-ci.org/zoubin/ansi-escape)\n\n## Usage\n\n```javascript\nvar csi = require('ansi-escape')\n\nconsole.log('1'.repeat(8))\nconsole.log(\n  csi\n    // underline text\n    .underline\n\n    // red text\n    .red\n\n    // move cursor one line up\n    .cursorUp\n\n    // move cursor 2 cells forward\n    .cursorForward(2)\n\n    // the text to be escaped\n    .escape('2'.repeat(4))\n)\n\n```\n\n**Output**\n\n![chain](example/chain.png)\n\n## escape\nType: `Function`\n\nAccept arguments like [util.format](https://nodejs.org/docs/latest/api/util.html#util_util_format_format).\n\n```js\nvar csi = require('ansi-escape')\n\nconsole.log(\n  csi.escape(\n    'Age: %d, Size: %j',\n    10,\n    { h: 180, w: 80 }\n  )\n)\n\n\n```\n\n**Output**\n\n```\nAge: 10, Size: {\"h\":180,\"w\":80}\n\n```\n\n\n## Cursors\n\n### cursorUp(n = 1)\n\nAlias: `cuu`, `up`\n\nMoves the cursor `n` cells up.\n\n### cursorDown(n = 1)\n\nAlias: `cud`, `down`\n\nMoves the cursor `n` cells down.\n\n### cursorForward(n = 1)\n\nAlias: `cuf`, `forward`\n\nMoves the cursor `n` cells forward.\n\n### cursorBackward(n = 1)\n\nAlias: `cub`, `back`\n\nMoves the cursor `n` cells backward.\n\n\n### cursorColumn(n = 1)\n\nAlias: `cha`, `col`\n\nMoves the cursor to column `n`.\n\n### cursorPosition(n = 1, m = 1)\n\nAlias: `cup`\n\nMoves the cursor to row `n`, column `m`.\n\n### eraseDisplay(n = 0)\n\nSugar: `eraseDisplayEnd`, `eraseDisplayStart`, `eraseDisplayEntire`\n\nClears part of the screen.\n\n* If `n` is 0 (or missing), clear from cursor to end of screen.\n* If `n` is 1, clear from cursor to beginning of the screen.\n* If `n` is 2, clear entire screen (and moves cursor to upper left on DOS ANSI.SYS).\n\n### eraseLine(n = 0)\n\nSugar: `eraseLineEnd`, `eraseLineStart`, `eraseLineEntire`\n\nErases part of the line.\n\n* If `n` is 0 (or missing), clear from cursor to the end of the line.\n* If `n` is 1, clear from cursor to beginning of the line.\n* If `n` is 2, clear entire line.\n\nCursor position does not change.\n\n### scrollUp(n = 1)\n\nAlias: `su`\n\nScroll whole page up by n (default 1) lines.\nNew lines are added at the bottom. \n\n### scrollDown(n = 1)\n\nAlias: `sd`\n\nScroll whole page down by n (default 1) lines.\nNew lines are added at the top.\n\n### saveCursorPosition\n\nAlias: `scp`, `saveCursor`\n\nSaves the cursor position.\n\n### restoreCursorPosition\n\nAlias: `rcp`, `restoreCursor`\n\nRestores the cursor position.\n\n### hideCursor\n\nAlias: `hide`\n\nHides the cursor.\n\n### showCursor\n\nAlias: `show`\n\nShows the cursor.\n\n## Styles\n\n### Modifiers\n\n* bold\n* dim\n* italic\n* underline\n* blink\n* inverse\n* hidden\n* strikethrough\n\n### Colors\n\n* black\n* red\n* green\n* yellow\n* blue\n* magenta\n* cyan\n* white\n\n### Background colors\n\n* bgBlack\n* bgRed\n* bgGreen\n* bgYellow\n* bgBlue\n* bgMagenta\n* bgCyan\n* bgWhite\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fansi-escape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fansi-escape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fansi-escape/lists"}