press-any-key
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -1,2 +0,2 @@ | ||
const sll = require("single-line-log").stdout; | ||
const sll = require("log-update"); | ||
const DEFAULT_MESSAGE = "Press any key to continue..." | ||
@@ -10,4 +10,5 @@ | ||
const preverseLog = options.preverseLog || false; | ||
const hideMessage = options.hideMessage || false; | ||
if (mssg) { | ||
if (mssg && !hideMessage) { | ||
sll(mssg); | ||
@@ -23,4 +24,5 @@ } | ||
if (mssg && !preverseLog) { | ||
sll(""); | ||
sll.clear(); | ||
} else { | ||
sll.done(); | ||
process.stdout.write("\n") | ||
@@ -27,0 +29,0 @@ } |
{ | ||
"name": "press-any-key", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Press any key to continue...", | ||
@@ -9,13 +9,17 @@ "main": "index.js", | ||
"dependencies": { | ||
"single-line-log": "^1.1.2" | ||
"log-update": "4.0.0" | ||
}, | ||
"bin": { | ||
"press-any-key": "main.js" | ||
"bin": "bin/cli.js", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"devDependencies": { | ||
"jest": "^29.7.0", | ||
"jest-sinon": "^1.1.0", | ||
"sinon": "^17.0.1", | ||
"strip-ansi": "^6.0.1" | ||
}, | ||
"directories": { | ||
"example": "examples" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest" | ||
}, | ||
@@ -35,4 +39,3 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/morulus/press-any-key#readme", | ||
"bin": "bin/cli.js" | ||
"homepage": "https://github.com/morulus/press-any-key#readme" | ||
} |
press-any-key | ||
== | ||
An utility to launch the simplest confirmation dialog. | ||
A utility to launch the simplest confirmation dialog. | ||
@@ -43,2 +43,3 @@ ``` | ||
`--preserve-log` Do not clean the message, after resolve | ||
`--hide-message` Do not show the massage | ||
@@ -87,3 +88,3 @@ ## How to route | ||
The message is a string that will be displayed in standard output, before it starts to listen for key pressing. Pass `null` if you'd like to use default message. | ||
The message is a string that will be displayed in the standard output before it starts to listen for key presses. Pass null if you'd like to use the default message. | ||
@@ -94,4 +95,5 @@ **Options:** | ||
- **`preverseLog`** Preserve the message in the log | ||
- **`hideMessage`** Do not show the message | ||
By the default when user presses CTRL+C the function will exit the process. But you able to change the standart behavior of CTRL+C by passing option `ctrlC` with the value `"reject"`. In this case, pressing CTRL+C wont exit the process, but do reject the promise. | ||
By default, when the user presses CTRL+C, the function will exit the process. However, you can change the standard behavior of CTRL+C by passing the option ctrlC with the value "reject". In this case, pressing CTRL+C will not exit the process but will instead reject the promise. | ||
@@ -98,0 +100,0 @@ ```js |
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
120
6949
4
5
70
+ Addedlog-update@4.0.0
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedastral-regex@2.0.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedlog-update@4.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedslice-ansi@4.0.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
- Removedsingle-line-log@^1.1.2
- Removedansi-regex@2.1.1(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedsingle-line-log@1.1.2(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstrip-ansi@3.0.1(transitive)