开发者

require() a node.js module?

开发者 https://www.devze.com 2023-01-22 18:08 出处:网络
I have a node.js module like this:开发者_如何学编程 # couchdb.js var couchdb = { // code } module.exports = couchdb;

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

精彩评论

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