@armit/terminal
Advanced tools
+6
-0
| # @armit/terminal | ||
| ## 0.2.9 | ||
| ### Patch Changes | ||
| - [`8236512`](https://github.com/armitjs/armit/commit/823651262a58bab2534c5667ca731f80623a2c04) Thanks [@tianyingchun](https://github.com/tianyingchun)! - bump version | ||
| ## 0.2.8 | ||
@@ -4,0 +10,0 @@ |
+1
-1
@@ -1,2 +0,2 @@ | ||
| import i from'cfonts';import l from'picocolors';import s from'terminal-link';var a=(r,t,e=!1)=>{i.say(r,{...t,env:"node"},e);};function c(r,t){return t||!r.length?e=>e:e=>{let o=e;for(let n=0;n<r.length;n++)o=l[r[n]](o);return o}}var d=(r,t)=>s(r,t);export{d as getTerminalLink,a as showBanner,c as terminalColor};//# sourceMappingURL=index.js.map | ||
| import i from'cfonts';import l from'picocolors';import s from'terminal-link';var a=(r,t,e=false)=>{i.say(r,{...t,env:"node"},e);};function c(r,t){return t||!r.length?e=>e:e=>{let o=e;for(let n=0;n<r.length;n++)o=l[r[n]](o);return o}}var d=(r,t)=>s(r,t);export{d as getTerminalLink,a as showBanner,c as terminalColor};//# 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":["showBanner","text","options","debug","cfonts","terminalColor","colors","noColor","x","out","i","C","getTerminalLink","url","terminalLink"],"mappings":"6EAwFaA,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"]} | ||
| {"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":"6EAwFaA,IAAAA,CAAAA,CAAa,CACxBC,CACAC,CAAAA,CAAAA,CACAC,CAAQ,CAAA,KAAA,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"]} |
+7
-7
| { | ||
| "name": "@armit/terminal", | ||
| "version": "0.2.8", | ||
| "version": "0.2.9", | ||
| "homepage": "https://github.com/armitjs/armit", | ||
@@ -51,11 +51,11 @@ "repository": { | ||
| "devDependencies": { | ||
| "@hyperse/eslint-config-hyperse": "^1.2.8", | ||
| "@types/node": "22.10.2", | ||
| "eslint": "^9.17.0", | ||
| "@hyperse/eslint-config-hyperse": "^1.2.10", | ||
| "@types/node": "22.13.1", | ||
| "eslint": "^9.20.0", | ||
| "npm-run-all": "4.1.5", | ||
| "rimraf": "6.0.1", | ||
| "tsup": "8.3.5", | ||
| "typescript": "5.7.2", | ||
| "tsup": "8.3.6", | ||
| "typescript": "5.7.3", | ||
| "vite-tsconfig-paths": "^5.1.4", | ||
| "vitest": "2.1.8" | ||
| "vitest": "3.0.5" | ||
| }, | ||
@@ -62,0 +62,0 @@ "engines": { |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
18132
1.1%