有没有办法从 package.json 在 nodejs 代码中获得版本?

Is there a way to get the version set in package.json in a nodejs app? I would want something like this

var port = process.env.PORT || 3000
app.listen port
console.log "Express server listening on port %d in %s mode %s", app.address().port, app.settings.env, app.VERSION

转载于:https://stackoverflow.com/questions/9153571/is-there-a-way-to-get-version-from-package-json-in-nodejs-code

查看全部
csdnceshi80
胖鸭
2012/02/05 22:15
  • node.js
  • versioning
  • npm
  • version
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

0个回复