New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

js-format

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-format

js format like c printf("%s, hello world", ["wangdana"])

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
2
-60%
Maintainers
1
Weekly downloads
 
Created
Source

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);

    will echo:
    wlh, hello world!, it's a good day! come here at 下午12点

test

    mocha

Keywords

js

FAQs

Package last updated on 01 Apr 2015

Related posts