当前位置: 首页 > news >正文

电商型网站建设价格凡客诚品陈年

电商型网站建设价格,凡客诚品陈年,wordpress 幻灯片,深圳专业网站建设公司Chalk Chalk 是粉笔的意思, 它想表达的是#xff0c;给我们的命令行中的文本添加颜色类似彩色粉笔的功能 在官方文档当中#xff0c;它的 Highlights 核心特性 Expressive API Highly performant No dependencies Ability to nest styles 256/Truecolor color support Auto-…Chalk Chalk 是粉笔的意思, 它想表达的是给我们的命令行中的文本添加颜色类似彩色粉笔的功能 在官方文档当中它的 Highlights 核心特性 Expressive API Highly performant No dependencies Ability to nest styles 256/Truecolor color support Auto-detects color support Doesnt extend String.prototype Clean and focused Actively maintained Used by ~86,000 packages as of October 4, 2022它的性能很高没有三方依赖它能够支持256以及真彩色的实现 也就是说这个库可以让你自己去定义它的色彩并不是说命令行中当中的256色之外能够支持更多如果终端不支持肯定也是无效的 在 2022.10.4 的时候已经有超过 86000个包 引用它 所以说它是一个非常非常流行的库 安装 $ npm i -S chalk 使用 // chalk.js const chalk require(chalk); console.log(chalk);这种情况下会报错会提示 Instead change the require of index.js in /Users/xxx/Desktop/ui/src/chalk.js to a dynamic import() which is available in all CommonJS modules.现在这个库已经默认使用 ES Module 了在其源码中都是用的 ES Module 的语法 现在可以通过两种方式解决 1.更改文件后缀,并在package.json中添加 type: module, 配置2.使用打包工具选择方案1import chalk from chalk; console.log(chalk.red(Hello Chalk) 这里就是默认颜色 chalk.blue( 这里是蓝色));从上面的例子可以看出多种种颜色混搭使用 再来看看链式调用 import chalk from chalk; console.log(chalk.red.bgGreen.bold(Hello Chalk));多参数方式 import chalk from chalk; console.log(chalk.red(hello, chalk))这样可以多参数拼接通过空格来拼接 嵌套调用 import chalk from chalk; console.log(chalk.red(Hello, chalk.underline(Chalk)));定义颜色在256色之外(rgb或hex随意定义)并嵌套 import chalk from chalk; console.log(chalk.rgb(255,255,0).underline(Hello Chalk)); // 链式调用 console.log(chalk.hex(#ff0000).bold(你好世界)); // 链式调用 console.log(chalk.hex(#0ff000)(Hello Wrold)); // 柯里化调用, 只能支持这种不能继续加()了基于以上示例可以定义一些列的工具函数, 例如 import chalk from chalk;const error (text) console.log(chalk.bold.hex(#ff0000)(text)); const warning (text) console.log(chalk.bold.hex(#ffa500)(text));error(Error) warning(Warning)自定义chalk使用, 传入一个Option参数其实目前就支持这一个level参数 import { Chalk } from chalk; // 拿到构造器 Chalk/** Specify the color support for Chalk.By default, color support is automatically detected based on the environment.Levels: - 0 - All colors disabled. - 1 - Basic 16 colors support. - 2 - ANSI 256 colors support. - 3 - Truecolor 16 million colors support. */ // const cc new Chalk({level: 0}) // 0 所有颜色不再支持调用 .red, .blue 等不会生效; 不在[0,3]抛异常 const cc new Chalk({level: 3}) // 0 所有颜色不再支持调用 .red, .blue 等不会生效console.log(cc.hex(#0ff000)(Hello Wrold));chalk-cli 文档https://www.npmjs.com/package/chalk-cli可全局安装 $ npm install --global chalk-cli可在全局生成一个 chalk 命令$ chalk --helpUsage$ chalk style ... string$ echo string | chalk style ...Options--template, -t Style template. The ~ character negates the style.--stdin Read input from stdin rather than from arguments.--no-newline, -n Dont emit a newline (\n) after the input.--demo Demo of all Chalk styles.Examples$ chalk red bold Unicorns Rainbows$ chalk -t {red.bold Unicorns Rainbows}$ chalk -t {red.bold Dungeons and Dragons {~bold.blue (with added fairies)}}$ echo Unicorns from stdin | chalk --stdin red bold-t 按照一定格式输出 $ chalk -t hello chalkhello chalk$ chalk -t {red hello chalk}hello chalk同样输出但是显示的是 红色 $ chalk -t {red.bold hello chalk}hello chalk标红并加粗 $ chalk red bold hello 或 chalk red bold hello chalk 输出 hello 或 hello chalk标红并加粗注意字符串中间有空格需要加引号 $ --stdin 接收上一个输入的结果 $ echo Hello Chalk | chalk red bold 这种会把 bold 当做参数输出的是 bold$ echo Hello Chalk | chalk red bold --stdin 像是这种, 会输出 Hello Chalk 并且标红加粗–stdin 会把上一个命令的结果透传到chalk中来进行展示 $ -n 不会触发新行 $ chalk -n red bold hello chalk这里就不会有换行展示红色字体之后紧接着系统, 如 hello chalk Wang:~ wang$ $ --demo 把 chalk 所有支持的命令都显示出来, 如下 这些都是它支持的用法包括前景色背景色等
http://www.zqtcl.cn/news/390417/

相关文章:

  • 曹鹏wordpress建站seo视频本溪做网站的公司
  • 提示网站有风险老电脑做网站服务器
  • 怎么做网站导航外链出入青岛最新通知今天
  • 济宁房产网站建设海外电商怎么做如何从零开始
  • 网站优化插件中国建设银采购发文网站
  • 重庆企业网站的推广电力建设集团网站
  • 长沙制作网站词条有哪些网站可以做
  • 网站 网页区别简单的网页设计作品
  • 济南做网站推广有哪些公司天津建设工程信息网官方
  • 番禺市桥网站建设有关网站建设的知识
  • 信用中国 网站 支持建设怎么做网站美工
  • 做网站怎么样引流郑州最好的妇科医院排行
  • 云软件网站建设做仓单的网站
  • 邯郸做移动网站报价注册公司流程流程图
  • linux部署wordpress福州短视频seo推荐
  • 做地推的网站做网站感觉挣不到钱啊
  • 网站建设公司哪家好 搜搜磐石网络营销网站建设免费
  • 如何改网站的内容源码买卖网站
  • 企业网站 报价免费创意字体设计
  • 调用百度地图做全景的网站网站维护要求
  • 济宁网上做科目一的网站网站维护工程师薪酬
  • 领先的响应式网站建设平台湖北企业建站系统信息
  • 嘉兴市住房和城乡建设局网站巩义网站建设方案报价
  • 桂林做网站的公司哪家最好长沙网络工程学院
  • 广州 天河网站设计wordpress评论开关
  • 河南郑州建设网站做贺卡网站
  • 我的家乡湛江网站设计烟台网站建设招聘
  • 如何做网站改版评析网站建设报价单
  • 有关天猫网站开发的论文热狗seo顾问
  • 西安成品网站建设云主机建网站教程