@astrojs/cli-kit
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,4 +0,5 @@ | ||
export declare const say: (messages?: string | string[], { clear }?: { | ||
export declare const say: (messages?: string | string[], { clear, hat }?: { | ||
clear?: boolean | undefined; | ||
hat?: string | undefined; | ||
}) => Promise<void>; | ||
export declare const label: (text: string, c?: import("chalk").ChalkInstance, t?: import("chalk").ChalkInstance) => string; |
@@ -6,3 +6,4 @@ import readline from 'node:readline'; | ||
import { action } from '../prompt/util/action.js'; | ||
export const say = async (messages = [], { clear = false } = {}) => { | ||
import { strip } from '../prompt/util/clear.js'; | ||
export const say = async (messages = [], { clear = false, hat = '' } = {}) => { | ||
const rl = readline.createInterface({ input: process.stdin, escapeCodeTimeout: 50 }); | ||
@@ -15,2 +16,3 @@ readline.emitKeypressEvents(process.stdin, rl); | ||
process.stdin.setRawMode(false); | ||
rl.close(); | ||
cancelled = true; | ||
@@ -44,4 +46,5 @@ if (i < messages.length - 1) { | ||
const face = (msg, { mouth = mouths[0], eye = eyes[0] } = {}) => { | ||
const head = '─'.repeat(3 - strip(hat).split('').length); | ||
return [ | ||
`╭─────╮ ${color.bold(color.cyan('Houston:'))}`, | ||
`╭──${hat}${head}╮ ${color.bold(color.cyan('Houston:'))}`, | ||
`│ ${eye} ${color.cyanBright(mouth)} ${eye} ${msg}`, | ||
@@ -48,0 +51,0 @@ `╰─────╯`, |
{ | ||
"name": "@astrojs/cli-kit", | ||
"type": "module", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -35,3 +35,7 @@ "types": "./dist/index.d.ts", | ||
"typescript": "^4.8.3" | ||
}, | ||
"volta": { | ||
"node": "18.9.0", | ||
"npm": "8.19.1" | ||
} | ||
} |
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
50991
1576