Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henry781/ngx-terminal
A fake terminal component for Angular
https://github.com/henry781/ngx-terminal
angular terminal
Last synced: 1 day ago
JSON representation
A fake terminal component for Angular
- Host: GitHub
- URL: https://github.com/henry781/ngx-terminal
- Owner: henry781
- Created: 2019-10-29T14:53:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T11:14:36.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T18:59:53.700Z (27 days ago)
- Topics: angular, terminal
- Language: TypeScript
- Homepage:
- Size: 8.2 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NGX Terminal
This component is a basic easy to use fake terminal for Angular.
![](https://user-images.githubusercontent.com/26506130/68243301-83457500-0012-11ea-8c2c-4c92eafb3020.gif)
## Usage
component.html
``````
component.ts
```
public server = 'localhost';
public login = 'henry781';onCommand(prompt: TerminalPrompt) {
switch (prompt.getCommand()) {case 'whoami':
prompt.response = prompt.login;
prompt.responseComplete();
break;default:
prompt.response = 'unknown command';
prompt.responseComplete();
}
}
```module.ts
```
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
TerminalModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
```## Features
### Autoscroll
This terminal supports autoscroll when the scroll position is at the end of the page.
It can be disabled using the input `autoscroll="false"`.### History (Up & Down)
Keyboard keys ↑ and ↓ allows to navigate in the command history.
### Ansi color
There is a peer dependency with lib [ansi_up](https://www.npmjs.com/package/ansi-up).
### Asynchronous response
### Cancel with ctrl+c
### HTML response