Thanks to @sel-fish
Use it in your Webpack config, Gulpfile.js, Express app or other Node project to set a distinct infomation on the right up corner of Iterm2.
var setIterm2Badge = require('set-iterm2-badge');
var port = '8088';
setIterm2Badge(port);
var setIterm2Badge = require('set-iterm2-badge');
var bs = require('browser-sync').create();
bs.init({
port: "8080"
}, function(err, bs) {
// The actual port may not be the passed in "8080"
// as bs ensures listen a empty port inside
setIterm2Badge(bs.options.getIn(['port']));
})