[github地址:https://github.com/ABCDdouyae...]

pad

给字符串的左右加padding,也可以用于删减字符串两端

用法:pad(str, length, options)|pad(length, str, options)

options:

  • char (string): 指定字符填充
  • colors (boolean):Ajust to hidden terminal color characters, you may also use require 'pad/lib/colors' to avoid passing this option.
  • strip (boolean):要求的长度小于原字符串长度,会对原字符串删减,默认false
  • fixed_width (boolean):An optimization option to disable the usage of the wcwdith package to handle the discovery of characters using more than one column for display. one column to display
  • wcwidth_options (object):Options passed to the wcwidth package used to calculate the display width of characters using more than one column.

返回:string

【每日一包0011】pad的更多相关文章

  1. 【每日一包0005】arr-flatten

    github地址:https://github.com/ABCDdouyae... arr-flatten 将多维数组展开成一维数组 文档地址:https://www.npmjs.com/packag ...

  2. 【每日一包0018】fecha

    [github地址:https://github.com/ABCDdouyae...] fecha 比moment.js更加轻量级的时间解析和格式化包 format 用法:format(<Dat ...

  3. 【每日一包0015】gradient-string

    [github地址:https://github.com/ABCDdouyae...] gradient-string 用于在终端打印出好看的渐变文字 普通用法 console.log(gradien ...

  4. 【每日一包0001】is-sorted

    github地址:https://github.com/ABCDdouyae... is-sorted 用于判断数组是否被排序了 文档地址:https://www.npmjs.com/package/ ...

  5. 【每日一包0003】kind-of

    github地址:https://github.com/ABCDdouyae... kind-of 判断数据类型用法:kind-of(date)返回:string 数据类型 January undef ...

  6. 【每日一包0008】arr-diff

    [github地址:https://github.com/ABCDdouyae...] arr-diff 多个数组比较,过滤出第一个数组独有的内容 用法:arr-diff(arr1, arr2, ar ...

  7. 【每日一包0009】group-array

    [github地址:https://github.com/ABCDdouyae...] group-array 对数组里面的多项按照指定的key进行整合 用法:group-array(arr, key ...

  8. 【每日一包0012】to-camel-case,to-no-case,to-space-case

    github地址:https://github.com/ABCDdouyaer/a_pack_per_day_NO.1 to-camel-case 将被其他符号分割的字符串转换为驼峰形式的字符串 用法 ...

  9. 【每日一包0002】array-first

    github地址:https://github.com/ABCDdouyae... array-first 获取数组的第一项或者前几项 文档地址:https://www.npmjs.com/packa ...

随机推荐

  1. Laravel从模型中图片的相对路径获取绝对路径

    在模型product.php中增加以下方法.数据库图片字段为image.存储的图片相对路径 public function getImageUrlAttribute() { // 如果 image 字 ...

  2. 获取web项目的绝对路径的方法总结

    一.用Jsp获取 1.获取文件的绝对路径 String file="文件";(例如:data.mdb) String path=application.getRealPath(fi ...

  3. [读书笔记]Hadoop权威指南 第3版

    下面归纳概述了用于设置MapReduce作业输出的压缩格式的配置属性.如果MapReduce驱动使用了Tool接口,则可以通过命令行将这些属性传递给程序,这比通过程序代码来修改压缩属性更加简便. Ma ...

  4. Guava -- 集合类 和 Guava Cache

    Guava -- 集合类 和 Guava Caches 1. 什么是 Guava Guava 是 google 推出的一个第三方 java 库,用来代替 jdk 的一些公共操作,给我印象特别深的就是 ...

  5. 面试常考的js题目(三)

    1.查找两个节点的最近的一个共同父节点,可以包括节点自身 function commonParentNode(oNode1, oNode2) { if(oNode1.contains(oNode2)) ...

  6. char 、 unsigned char 互相转化

    1. 利用unsigned char (即uchar) 保存char 数据  ,直接赋值即可 unsigned char uc; char c=-33; uc= c; cout<<(int ...

  7. Java对象的序列化和反序列化介绍

    一.什么序列化和反序列化以及作用: java序列化是指把java对象转换为字节序列的过程,而java反序列化是指把字节序列恢复为java对象的过程 1.序列化: 1)对象序列化的最主要的用处就是在传递 ...

  8. Docker 部署mysql、tomcat笔记

    Docker 笔记整理 #.环境:Ubuntu 18.* #.安装 mysql 5.6.tomcat #.docker search mysql 报错:Error response from daem ...

  9. ffmpeg处理视频命令

    一:视频添加图片水印 ffmpeg -i a.mp4 -vf "movie=a.jpg[watermark];[in][watermark] overlay=main_w-overlay_w ...

  10. 安装grafna已经grafna对接zabbix

    安装插件 grafana-cli plugins install alexanderzobnin-zabbix-app 重启grafna systemctl restart grafana-serve ...