@armit/terminal
Advanced tools
+6
-0
| # @armit/terminal | ||
| ## 0.2.4 | ||
| ### Patch Changes | ||
| - [`578a7c8`](https://github.com/armitjs/armit/commit/578a7c89178272ca2ce7d622305f6983490ec69e) Thanks [@tianyingchun](https://github.com/tianyingchun)! - bump version | ||
| ## 0.2.3 | ||
@@ -4,0 +10,0 @@ |
+1
-1
@@ -8,3 +8,3 @@ import i from 'cfonts'; | ||
| export { d as getTerminalLink, a as showBanner, c as terminalColor }; | ||
| //# sourceMappingURL=out.js.map | ||
| //# sourceMappingURL=index.js.map | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/terminal-banner.ts","../src/terminal-color.ts","../src/terminal-link.ts"],"names":["cfonts","showBanner","text","options","debug","C","terminalColor","colors","noColor","x","out","i","terminalLink","getTerminalLink","url"],"mappings":"AAAA,OAAOA,MAAY,SAwFZ,IAAMC,EAAa,CACxBC,EACAC,EACAC,EAAQ,KACL,CACHJ,EAAO,IACLE,EACA,CACE,GAAGC,EACH,IAAK,MACP,EACAC,CACF,CACF,ECpGA,OAAOC,MAAO,aAgBP,SAASC,EAAcC,EAA0BC,EAAmB,CACzE,OAAIA,GAAW,CAACD,EAAO,OAEbE,GAAcA,EAEhBA,GAAc,CACpB,IAAIC,EAAcD,EAClB,QAASE,EAAI,EAAGA,EAAIJ,EAAO,OAAQI,IACjCD,EAAML,EAAEE,EAAOI,CAAC,CAAC,EAAED,CAAG,EAExB,OAAOA,CACT,CACF,CC7BA,OAAOE,MAAkB,gBAMlB,IAAMC,EAAkB,CAACX,EAAcY,IACrCF,EAAaV,EAAMY,CAAG","sourcesContent":["import cfonts from 'cfonts';\n\ntype BannerFontsOptions = {\n /**\n * define the font face\n * e.g. `'block'`\n */\n font:\n | 'console'\n | 'block'\n | 'simpleBlock'\n | 'simple'\n | '3d'\n | 'simple3d'\n | 'chrome'\n | 'huge'\n | 'shade'\n | 'slick'\n | 'grid'\n | 'pallet'\n | 'tiny';\n /**\n * define text alignment\n * e.g. `'left'`\n */\n align: 'left' | 'center' | 'right' | 'top' | 'bottom';\n /**\n * define all colors\n * e.g. `['system']`\n */\n colors: Array<\n | 'system'\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'gray'\n | 'redBright'\n | 'greenBright'\n | 'yellowBright'\n | 'blueBright'\n | 'magentaBright'\n | 'cyanBright'\n | 'whiteBright'\n | '#ff8800'\n | 'hex-colors'\n >;\n /**\n * define the background color'|'you can also use `backgroundColor` here as key\n * `'transparent'`\n */\n background: string;\n /**\n * define letter spacing\n */\n letterSpacing: number;\n /**\n * define the line height\n */\n lineHeight: number;\n /**\n * define if the output text should have empty lines on top and on the bottom\n */\n space: boolean;\n /**\n * define how many character can be on one line\n */\n maxLength: number;\n /**\n * define your two gradient colors\n * @example `red,blue,green`\n */\n gradient: string;\n /**\n * define if you want to recalculate the gradient for each new line\n * @example `red,blue`\n */\n independentGradient: string;\n /**\n * define if this is a transition between colors directly\n * @example `red,blue,green`\n */\n transitionGradient: string;\n};\nexport const showBanner = (\n text: string,\n options: Partial<BannerFontsOptions>,\n debug = false\n) => {\n cfonts.say(\n text,\n {\n ...options,\n env: 'node',\n },\n debug\n );\n};\n","import type picocolors from 'picocolors';\nimport C from 'picocolors';\n\n/**\n * Represents an ANSI color.\n */\nexport type Color = Exclude<\n keyof typeof picocolors,\n 'createColors' | 'isColorSupported'\n>;\n\n/**\n * Terminal output formatting with ANSI colors\n * @param colors The colors for the console output\n * @param noColor Removes colors from the console output\n * @returns\n */\nexport function terminalColor(colors: readonly Color[], noColor?: boolean) {\n if (noColor || !colors.length) {\n // Pure text output.\n return (x: string) => x;\n }\n return (x: string) => {\n let out: string = x;\n for (let i = 0; i < colors.length; i++) {\n out = C[colors[i]](out);\n }\n return out;\n };\n}\n","import terminalLink from 'terminal-link';\n/**\n * Create a link for use in stdout.\n * @param text Text to linkify.\n * @param url URL to link to.\n */\nexport const getTerminalLink = (text: string, url: string): string => {\n return terminalLink(text, url);\n};\n"]} | ||
| {"version":3,"sources":["../src/terminal-banner.ts","../src/terminal-color.ts","../src/terminal-link.ts"],"names":["showBanner","text","options","debug","cfonts","terminalColor","colors","noColor","x","out","i","C","getTerminalLink","url","terminalLink"],"mappings":";;;;AAwFaA,IAAAA,CAAAA,CAAa,CACxBC,CACAC,CAAAA,CAAAA,CACAC,CAAQ,CAAA,CAAA,CAAA,GACL,CACHC,CAAAA,CAAO,GACLH,CAAAA,CAAAA,CACA,CACE,GAAGC,CAAAA,CACH,GAAK,CAAA,MACP,CACAC,CAAAA,CACF,EACF,ECpFO,SAASE,CAAAA,CAAcC,EAA0BC,CAAmB,CAAA,CACzE,OAAIA,CAAAA,EAAW,CAACD,CAAO,CAAA,MAAA,CAEbE,CAAcA,EAAAA,CAAAA,CAEhBA,CAAc,EAAA,CACpB,IAAIC,CAAAA,CAAcD,EAClB,IAASE,IAAAA,CAAAA,CAAI,CAAGA,CAAAA,CAAAA,CAAIJ,EAAO,MAAQI,CAAAA,CAAAA,EAAAA,CACjCD,CAAME,CAAAA,CAAAA,CAAEL,EAAOI,CAAC,CAAC,CAAED,CAAAA,CAAG,CAExB,CAAA,OAAOA,CACT,CACF,CCvBO,IAAMG,EAAkB,CAACX,CAAAA,CAAcY,CACrCC,GAAAA,CAAAA,CAAab,EAAMY,CAAG","file":"index.js","sourcesContent":["import cfonts from 'cfonts';\n\ntype BannerFontsOptions = {\n /**\n * define the font face\n * e.g. `'block'`\n */\n font:\n | 'console'\n | 'block'\n | 'simpleBlock'\n | 'simple'\n | '3d'\n | 'simple3d'\n | 'chrome'\n | 'huge'\n | 'shade'\n | 'slick'\n | 'grid'\n | 'pallet'\n | 'tiny';\n /**\n * define text alignment\n * e.g. `'left'`\n */\n align: 'left' | 'center' | 'right' | 'top' | 'bottom';\n /**\n * define all colors\n * e.g. `['system']`\n */\n colors: Array<\n | 'system'\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'gray'\n | 'redBright'\n | 'greenBright'\n | 'yellowBright'\n | 'blueBright'\n | 'magentaBright'\n | 'cyanBright'\n | 'whiteBright'\n | '#ff8800'\n | 'hex-colors'\n >;\n /**\n * define the background color'|'you can also use `backgroundColor` here as key\n * `'transparent'`\n */\n background: string;\n /**\n * define letter spacing\n */\n letterSpacing: number;\n /**\n * define the line height\n */\n lineHeight: number;\n /**\n * define if the output text should have empty lines on top and on the bottom\n */\n space: boolean;\n /**\n * define how many character can be on one line\n */\n maxLength: number;\n /**\n * define your two gradient colors\n * @example `red,blue,green`\n */\n gradient: string;\n /**\n * define if you want to recalculate the gradient for each new line\n * @example `red,blue`\n */\n independentGradient: string;\n /**\n * define if this is a transition between colors directly\n * @example `red,blue,green`\n */\n transitionGradient: string;\n};\nexport const showBanner = (\n text: string,\n options: Partial<BannerFontsOptions>,\n debug = false\n) => {\n cfonts.say(\n text,\n {\n ...options,\n env: 'node',\n },\n debug\n );\n};\n","import type picocolors from 'picocolors';\nimport C from 'picocolors';\n\n/**\n * Represents an ANSI color.\n */\nexport type Color = Exclude<\n keyof typeof picocolors,\n 'createColors' | 'isColorSupported'\n>;\n\n/**\n * Terminal output formatting with ANSI colors\n * @param colors The colors for the console output\n * @param noColor Removes colors from the console output\n * @returns\n */\nexport function terminalColor(colors: readonly Color[], noColor?: boolean) {\n if (noColor || !colors.length) {\n // Pure text output.\n return (x: string) => x;\n }\n return (x: string) => {\n let out: string = x;\n for (let i = 0; i < colors.length; i++) {\n out = C[colors[i]](out);\n }\n return out;\n };\n}\n","import terminalLink from 'terminal-link';\n/**\n * Create a link for use in stdout.\n * @param text Text to linkify.\n * @param url URL to link to.\n */\nexport const getTerminalLink = (text: string, url: string): string => {\n return terminalLink(text, url);\n};\n"]} |
+8
-8
| { | ||
| "name": "@armit/terminal", | ||
| "version": "0.2.3", | ||
| "version": "0.2.4", | ||
| "homepage": "https://github.com/armitjs/armit", | ||
@@ -52,13 +52,13 @@ "repository": { | ||
| "@hyperse/eslint-config-hyperse": "^1.0.10", | ||
| "@types/node": "20.14.10", | ||
| "@vitest/coverage-istanbul": "2.0.2", | ||
| "@vitest/ui": "2.0.2", | ||
| "@types/node": "20.14.12", | ||
| "@vitest/coverage-istanbul": "2.0.4", | ||
| "@vitest/ui": "2.0.4", | ||
| "eslint": "^9.7.0", | ||
| "npm-run-all": "4.1.5", | ||
| "rimraf": "6.0.1", | ||
| "tsup": "8.1.0", | ||
| "typescript": "5.5.3", | ||
| "vite": "5.3.3", | ||
| "tsup": "8.2.2", | ||
| "typescript": "5.5.4", | ||
| "vite": "5.3.4", | ||
| "vite-tsconfig-paths": "4.3.2", | ||
| "vitest": "2.0.2" | ||
| "vitest": "2.0.4" | ||
| }, | ||
@@ -65,0 +65,0 @@ "engines": { |
17251
2.2%