【文件属性】:
文件名称:js-format:js format, concat str 拼接字符串
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-15 08:23:13
JavaScript
js-format
简化js中拼接字符串过程,忘掉那该死的加号吧! fuck ‘+’
install 安装:
node下:
npm install js-format --save
usage 使用:
>1. %s,%d,%f 格式
var str = '%s, hello world!';
str = format(str, ["wlh"]);
will echo:
wlh, hello world!
>2. :placeholder 格式
var str = ":user, hello world!, it's a good day! come here at :time";
var obj = {user: "wlh", time: "下午12点"};
str = format(str, obj);
wi
【文件预览】:
js-format-master
----lib()
--------format.js(917B)
----test.js(95B)
----LICENSE(1KB)
----test()
--------format.test.js(870B)
----README.md(679B)
----.gitignore(526B)
----index.js(106B)
----package.json(567B)