开发者

require() a node.js module?

I have a node.js module like this:

开发者_如何学编程
# couchdb.js

var couchdb = {
  // code
}

module.exports = couchdb;

How do I do to be able to use require("couchdb") in all my files?


Put your module into folder ~/.node_libraries/ to make it available for all scripts

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜