{"id":25241309,"url":"https://github.com/lucenden/unix-terminal-emulator","last_synced_at":"2026-04-30T11:32:19.187Z","repository":{"id":45738338,"uuid":"511801613","full_name":"LucEnden/unix-terminal-emulator","owner":"LucEnden","description":"A simple plugin for emulating the unix terminal in the browser!","archived":false,"fork":false,"pushed_at":"2025-07-14T09:41:32.000Z","size":4657,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T06:44:59.975Z","etag":null,"topics":["bash","npm","react","typescript","unix"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/LucEnden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-08T07:20:33.000Z","updated_at":"2025-07-14T09:41:36.000Z","dependencies_parsed_at":"2024-10-24T13:07:52.846Z","dependency_job_id":"1cc61a9d-425b-4127-861a-7ea7ea5aaa11","html_url":"https://github.com/LucEnden/unix-terminal-emulator","commit_stats":{"total_commits":112,"total_committers":2,"mean_commits":56.0,"dds":0.0714285714285714,"last_synced_commit":"a6808a29720de85342294d74ad049b368ac97a53"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/LucEnden/unix-terminal-emulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucEnden%2Funix-terminal-emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucEnden%2Funix-terminal-emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucEnden%2Funix-terminal-emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucEnden%2Funix-terminal-emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LucEnden","download_url":"https://codeload.github.com/LucEnden/unix-terminal-emulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LucEnden%2Funix-terminal-emulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279025389,"owners_count":26087975,"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-10-14T02:00:06.444Z","response_time":60,"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":["bash","npm","react","typescript","unix"],"created_at":"2025-02-11T21:03:13.110Z","updated_at":"2025-10-14T23:31:49.566Z","avatar_url":"https://github.com/LucEnden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e This package is no longer being maintained. Feel free to copy, modify and distribute all the files from this repository without restrictions!\n\u003e (PS: a small shoutout would be much appreasiated)\n\n---\n\n# Terminal Emulator\n\n![ci (build and test)](https://img.shields.io/github/workflow/status/LucEnden/unix-terminal-emulator/CI?label=CI%20%28build%20and%20test%29\u0026style=flat-square)\n![coverage](https://img.shields.io/codecov/c/github/LucEnden/unix-terminal-emulator?style=flat-square\u0026token=QHWVZR2MQ5)\n![issues](https://img.shields.io/github/issues/LucEnden/unix-terminal-emulator?style=flat-square)\n![npm score](https://img.shields.io/npms-io/final-score/unix-terminal-emulator?label=npm%20score\u0026style=flat-square)\n![dependencies](https://img.shields.io/librariesio/release/npm/unix-terminal-emulator?style=flat-square)\n![minified size](https://img.shields.io/bundlephobia/min/unix-terminal-emulator?label=minified%20size\u0026style=flat-square)\n![downloads](https://img.shields.io/npm/dw/unix-terminal-emulator?style=flat-square)\n![license](https://img.shields.io/github/license/LucEnden/unix-terminal-emulator?style=flat-square)\n\n![Preview](preview.gif)\n\n![NPM Repository](https://www.npmjs.com/package/unix-terminal-emulator) -\n![CodeSandbox example](https://codesandbox.io/s/unix-terminal-emulator-example-5n9ylu?file=index.html)\n\nInspired by ![TypewriterJS](https://www.npmjs.com/package/typewriter-effect).\n\n---\n\n- [Installation](#installation)\n- [Documentation](#documentation)\n- [Example usage](#example-usage)\n\t- [Browser](#browser)\n\t- [React](#react)\n- [Do's and don'ts](#dos-and-donts)\n- [Performance](#performance)\n\n## Installation\n\nYou can install it via your preferred package manager:\n\n```shell\nnpm i --save unix-terminal-emulator\n```\n\n```shell\nyarn add unix-terminal-emulator\n```\n\nYou can use the CDN version for simple imports in HTML:\n\n```html\n\u003cscript src=\"https://unpkg.com/unix-terminal-emulator@latest/dist/core.js\"\u003e\u003c/script\u003e\n```\n\n## Documentation\n\nCheckout [the wiki](https://github.com/LucEnden/unix-terminal-emulator/wiki) of this repository for the documentation.\nGenerated with [TypeDoc](https://typedoc.org/)!\n\n## Example usage\n\nFor more advanced examples, please click [this link](https://codesandbox.io/s/unix-terminal-emulator-example-5n9ylu?file=index.html).\n\n### Browser\n\n```javascript\nimport UnixTerminalEmulator from \"unix-terminal-emulator\"\n\nconst terminal = new UnixTerminalEmulator()\nconst command = {\n\ttext: \"echo Hello, World!\",\n\twriteSpeed: \"neutral\",\n\toutput: \"Hello, World!\",\n\tpauseBeforeOutput: 500,\n}\nterminal.writeCommand(command).run(() =\u003e {\n\tconsole.log(\"Done!\")\n})\n```\n\n### React\n\n```javascript\nimport React from \"react\"\nimport UnixTerminalEmulator from \"unix-terminal-emulator\"\n\nexport default function App() {\n\tconst command = {\n\t\ttext: \"echo Hello, World!\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"Hello, World!\",\n\t\tpauseBeforeOutput: 500,\n\t}\n\treturn (\n\t\t\u003cdiv className=\"App\"\u003e\n\t\t\t\u003cUnixTerminalEmulator\n\t\t\t\tonInit={emulator =\u003e {\n\t\t\t\t\temulator.writeCommand(command).run(() =\u003e {\n\t\t\t\t\t\tconsole.log(\"Done!\")\n\t\t\t\t\t})\n\t\t\t\t}}\n\t\t\t/\u003e\n\t\t\u003c/div\u003e\n\t)\n}\n```\n\n## Do's and don'ts\n\nBelow are a few examples of do's and don'ts regarding building a command sequence.\n\n```javascript\nconst terminal = new UnixTerminalEmulator()\n```\n\n---\n\n:heavy_check_mark: Chain the commands you want to run in sequence before calling run (this is by design):\n\n```javascript\n// Chaining commands is by design\nterminal\n\t.writeCommand({\n\t\ttext: \"echo foo\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"foo\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.pause(1000)\n\t.writeCommand({\n\t\ttext: \"echo bar\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"bar\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.run()\n```\n\n---\n\n:heavy_check_mark: Call the sequence building commands in a non-chain fashion, as long as the run method is called last (this is by design):\n\n```javascript\nterminal.writeCommand({\n\ttext: \"echo foo\",\n\twriteSpeed: \"neutral\",\n\toutput: \"foo\",\n\tpauseBeforeOutput: 500,\n})\nterminal.pause(1000)\nterminal.writeCommand({\n\ttext: \"echo bar\",\n\twriteSpeed: \"neutral\",\n\toutput: \"bar\",\n\tpauseBeforeOutput: 500,\n})\nterminal.run()\n```\n\n---\n\n:warning: Adding commands to the sequence BEFORE run has finished will queue them for the current sequence (this is timing dependent and not recommended).\n\n```javascript\nterminal\n\t.writeCommand({\n\t\ttext: \"echo foo\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"foo\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.run()\n// The command added bellow will be added to the current sequence\nterminal.writeCommand({\n\ttext: \"echo bar\",\n\twriteSpeed: \"neutral\",\n\toutput: \"bar\",\n\tpauseBeforeOutput: 500,\n})\n// The command bellow in the setTimeout will not run in the first sequence, a new call to the run method is required in order to run it\nsetTimeout(() =\u003e {\n\tterminal.writeCommand({\n\t\ttext: \"echo baz\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"baz\",\n\t\tpauseBeforeOutput: 500,\n\t})\n}, 10000)\n```\n\n---\n\n:x: Calling the run method on a terminal instance before the previous call has finished will result in unexpected behavior\n\n```javascript\nterminal\n\t.writeCommand({\n\t\ttext: \"echo foo\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"foo\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.writeCommand({\n\t\ttext: \"echo bar\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"bar\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.run()\nterminal.run() // this brakes the sequence and will result in unexpected behavior\n```\n\n---\n\n:x: Creating 2 terminal instances with the same wrapper and cursor ID will result in unexpected behavior\n\n```javascript\nconst terminal1 = new UnixTerminalEmulator({\n\twrapperId: \"same-wrapper-id\",\n\tcursorId: \"same-cursor-id\",\n})\nconst terminal2 = new UnixTerminalEmulator({\n\twrapperId: \"same-wrapper-id\",\n\tcursorId: \"same-cursor-id\",\n})\nterminal1\n\t.writeCommand({\n\t\ttext: \"echo foo\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"foo\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.run()\nterminal2\n\t.writeCommand({\n\t\ttext: \"echo foo\",\n\t\twriteSpeed: \"neutral\",\n\t\toutput: \"foo\",\n\t\tpauseBeforeOutput: 500,\n\t})\n\t.run()\n```\n\n## Performance\n\nBellow are performance charts based on different versions of the app. [Click here](tests/performance/performance_testing.md) for a detailed explanation about how the performance was tested. [Click here](https://docs.google.com/spreadsheets/d/e/2PACX-1vSAKSUTB6fm6-PQNgSEpBtxe9h_v1m2JiYnl--0hHiyvHMK8Yrdz16e5Y8X9kPmBm0HvIJPgchSufp4/pubhtml) for an interactive version of the graphs.\n\n| Time per Run in MS                                                                    | Time per Command in MS                                                                        |\n| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |\n| ![Time per run in MS graph of all versions](tests/performance/time_per_run_in_ms.svg) | ![Time per command in MS graph of all versions](tests/performance/time_per_command_in_ms.svg) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucenden%2Funix-terminal-emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucenden%2Funix-terminal-emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucenden%2Funix-terminal-emulator/lists"}