autorespond
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -27,8 +27,9 @@ #!/usr/bin/env node | ||
/* external requirements */ | ||
const yargs = require("yargs") | ||
const chalk = require("chalk") | ||
const pty = require("node-pty") | ||
const yargs = require("yargs") | ||
const chalk = require("chalk") | ||
const stripAnsi = require("strip-ansi") | ||
const pty = require("node-pty") | ||
/* internal requirements */ | ||
const my = require("./package.json") | ||
const my = require("./package.json") | ||
@@ -188,12 +189,17 @@ /* establish asynchronous context */ | ||
process.stdin.on("data", (data) => { | ||
/* clear soft timer */ | ||
if (timerSoft !== null) { | ||
clearTimeout(timerSoft) | ||
timerSoft = null | ||
} | ||
/* let timers react only on user input, | ||
not terminal responses to escape sequences */ | ||
const plain = stripAnsi(data.toString()) | ||
if (plain !== "") { | ||
/* clear soft timer */ | ||
if (timerSoft !== null) { | ||
clearTimeout(timerSoft) | ||
timerSoft = null | ||
} | ||
/* reset hard timer */ | ||
if (timerHard !== null) { | ||
clearTimeout(timerHard) | ||
timerHard = setTimeout(sendResponse, argv.timeoutHard * 1000) | ||
/* reset hard timer */ | ||
if (timerHard !== null) { | ||
clearTimeout(timerHard) | ||
timerHard = setTimeout(sendResponse, argv.timeoutHard * 1000) | ||
} | ||
} | ||
@@ -200,0 +206,0 @@ |
@@ -6,3 +6,3 @@ { | ||
"keywords": [ "terminal", "command", "stdin", "automatic", "response" ], | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"license": "MIT", | ||
@@ -41,2 +41,3 @@ "author": { | ||
"chalk": "4.1.0", | ||
"strip-ansi": "6.0.0", | ||
"node-pty": "0.9.0" | ||
@@ -43,0 +44,0 @@ }, |
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
23129
214
4
+ Addedstrip-ansi@6.0.0
+ Addedstrip-ansi@6.0.0(transitive)