【文件属性】:
文件名称:Fomatto:JavaScript字符串插值和格式
文件大小:24KB
文件格式:ZIP
更新时间:2021-05-22 23:28:48
JavaScript
Fōmatto-日语格式
Fōmatto为JavaScript提供了重量轻的字符串插值和格式设置。
该库带有Formatter工厂和FormatError 。
用法
为了使用Fōmatto,有必要在Formatter工厂中创建一个format函数。
Formatter([formats])
format功能
format ( template , arg1 [ , arg2 , arg3 , ... argN ] )
format函数将模板和多个参数,一个数组或类似数组的对象(具有length属性类型为Number对象)或标准对象作为其参数。
> format ( 'Good {} Sir {}.' , 'morning' , 'Lancelot' )
'Good morning Sir Lancelot.'
> format ( 'Good {0
【文件预览】:
Fomatto-master
----package.json(733B)
----test()
--------test.js(16KB)
--------test.html(393B)
--------nodeunit.js(54KB)
----LICENSE(1KB)
----lib()
--------fomatto.js(9KB)
----README.md(4KB)