Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个节点模块,我希望它可以作为独立函数调用,也可以作为库调用。如果单独调用它需要解析命令行参数等。如果需要,它需要,好吧,不是。节点文件能否告诉它是如何被调用的,如果直接调用 from node <file>,执行与需要时不同的代码路径?
node <file>