[英]How do I export multiple 'sub-modules' from one node.js module?
Here's what I mean by exporting 'sub-modules': 这就是我导出“子模块”的意思:
var fibers = require('fibers'); // this works, it's the 'main' module
var future = require('fibers/future'); // this also works, it's a 'sub'-module
How would I do this 'abc/xyz' export? 我将如何导出“ abc / xyz”? I've gone through the
fibers
source code a little bit, and it doesn't seem like this is something that node/npm will do for me. 我已经阅读了一些
fibers
源代码,似乎这不是node / npm为我做的事情。
It represents an actual filesystem path. 它代表实际的文件系统路径。 So, in the root directory of your abc module, call a file
xyz.js
or xyz.json
, or create an xyz/
directory with an index.js
. 因此,在abc模块的根目录中,调用文件
xyz.js
或xyz.json
,或使用index.js
创建一个xyz/
目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.