node-justify:使用自定义宽度和字符向左或向右(或两者)对齐文本

时间:2021-06-24 08:01:26
【文件属性】:
文件名称:node-justify:使用自定义宽度和字符向左或向右(或两者)对齐文本
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-24 08:01:26
JavaScript 证明合法 使用自定义宽度和字符向左或向右(或两者)对齐文本 用法 var justify = require ( 'justify' ) ; justify ( 'foo' , 'bar' , 10 ) ; // => "foo bar" justify ( 'foo' , 'bar' , 15 ) ; // => "foo bar" 您也可以传递自定义字符或字符串以使用分隔符, justify将循环遍历c所有字符,直到创建正确大小的字符串 justify ( 'foo' , 'bar' , 15 , { c : '.' } ) ; // => "foo.........bar" justify ( 'foo' , 'bar' , 15 , { c : '-=' } ) ; // => "foo-=-=-=-=-bar" 您还可以省略第一个或第二个参数(或两者
【文件预览】:
node-justify-master
----README.md(2KB)
----justify.js(610B)
----tests()
--------simple.js(129B)
--------complex.js(1KB)
----.gitignore(13B)
----package.json(619B)

网友评论