console-gui-tools
Advanced tools
Comparing version 1.1.0 to 1.1.1
15
index.js
@@ -25,3 +25,3 @@ import { EventEmitter } from "events" | ||
if (options.logsPageSize) { | ||
this.guiLogsRowsPerPage = options.rowsPerPage | ||
this.guiLogsRowsPerPage = options.logsPageSize | ||
} | ||
@@ -156,3 +156,3 @@ if (options.layoutBorder) { | ||
this.stdOut.push(chalk.white(message)) | ||
this.updateLogsConsole() | ||
this.updateLogsConsole(true) | ||
} | ||
@@ -162,3 +162,3 @@ | ||
this.stdOut.push(chalk.red(message)) | ||
this.updateLogsConsole() | ||
this.updateLogsConsole(true) | ||
} | ||
@@ -168,3 +168,3 @@ | ||
this.stdOut.push(chalk.yellow(message)) | ||
this.updateLogsConsole() | ||
this.updateLogsConsole(true) | ||
} | ||
@@ -174,6 +174,9 @@ | ||
this.stdOut.push(chalk.blue(message)) | ||
this.updateLogsConsole() | ||
this.updateLogsConsole(true) | ||
} | ||
updateLogsConsole() { | ||
updateLogsConsole(resetCursor) { | ||
if (resetCursor) { | ||
this.logScrollIndex = 0 | ||
} | ||
if (this.stdOut.length > this.guiLogsRowsPerPage) { | ||
@@ -180,0 +183,0 @@ this.layout.setPage2(this.stdOut.slice(this.stdOut.length - this.logScrollIndex - this.guiLogsRowsPerPage, this.stdOut.length - this.logScrollIndex).join('\n')) |
{ | ||
"name": "console-gui-tools", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A simple library to draw option menu or other popup inputs and layout on Node.js console.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ # console-gui-tools | ||
# users-session-manager | ||
# console-gui-tools | ||
A simple Node.js library to create Console Apps like wizard (or maybe if you like old style colored screen or something like "teletext" programs 😂) | ||
@@ -14,2 +14,5 @@ Apart from jokes, it is a library that allows you to create a screen divided into a part with everything you want to see (such as variable values) and another in which the logs run. | ||
![Animation](https://user-images.githubusercontent.com/14907987/162479866-e53f0634-8e96-4c23-9f32-ee920b7cdf2f.gif) | ||
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=elius94&repo=console-gui-tools&theme=github_dark&show_icons=true)](https://github.com/Elius94/console-gui-tools) [![https://nodei.co/npm/console-gui-tools.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/console-gui-tools.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/console-gui-tools) | ||
@@ -162,8 +165,6 @@ | ||
![image](https://user-images.githubusercontent.com/14907987/162258068-97fb5fd0-3546-430b-9a90-14dae6b72542.png) | ||
![Animation](https://user-images.githubusercontent.com/14907987/162480195-b08b4a0b-5d10-4122-8bff-9210295aac1f.gif) | ||
Pressing enter it will close the popup and set the new value: | ||
Pressing enter it will close the popup and set the new value | ||
![image](https://user-images.githubusercontent.com/14907987/162258174-7b5bd516-608b-4e03-a549-502cffc4b0a2.png) | ||
## To create an input popup (numeric or string) | ||
@@ -187,8 +188,5 @@ ```js | ||
![image](https://user-images.githubusercontent.com/14907987/161997181-07993f9a-6ad2-4c77-a834-2bbc4ed53a1e.png) | ||
![Animation](https://user-images.githubusercontent.com/14907987/162480554-3e29513b-13d1-4d3f-bd16-09cba30db358.gif) | ||
Only numbers are allowed. | ||
![image](https://user-images.githubusercontent.com/14907987/161997601-522eef0c-b3a8-47b8-b174-6cb12266fb1c.png) | ||
If you set isNumeric to true, only numbers are allowed. | ||
All class of components will be destroyed when the popup is closed. The event listeners are removed from the store. Then the garbage collector will clean the memory. | ||
@@ -206,7 +204,11 @@ | ||
And they written to the bottom of the page. | ||
![Animation](https://user-images.githubusercontent.com/14907987/162482192-042d88e5-f810-4523-8f0d-1d87a573d1b1.gif) | ||
You can switch to the log view by pressing the "changeLayoutKey" key or combination: | ||
The maximum number of lines is set to 10 by default but you can change it by setting the option "logsPageSize". | ||
When the logs exceed the limit, you can scroll up and down with up and down arrows (if you are in the log view). | ||
![Animation](https://user-images.githubusercontent.com/14907987/162482410-bfe26922-88f5-46bd-8659-059fcc698cf8.gif) | ||
This library is in development now. New componets will come asap. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36759
707
210