nodejs __dirname 与 process.cwd(); 的区别
2016-05-11 17:01
537 查看
var cwd = process.cwd(); console.log(cwd); console.log(__dirname);
cwd() 是当前执行node命令时候的文件夹地址
__dirname 是被执行的js 文件的地址
参考文档 http://stackoverflow.com/questions/9874382/whats-the-difference-between-process-cwd-vs-dirname
相关文章推荐
- 在Win10上发布Meteor应用
- 在Win10上发布Meteor应用
- LintCode:Swap Two Nodes in Linked List
- 222. Count Complete Tree Nodes
- #24 Swap Nodes in Pairs
- 【Leetcode】:116. Populating Next Right Pointers in Each Node 问题 in JAVA
- xpath与nodejs解析xml
- nodejs xpath
- Jenkins Slave Nodes – using the Swarm Plugin
- HADOOP 启动NodeManager闪退,logs信息:java.net.NoRouteToHostException: 没有到主机的路由
- [NodeJS]Jenkins-cli
- Hadoop2源码分析-HDFS datanode核心模块分析
- Node.js机制及原理理解初步
- LeetCode 025 Reverse Nodes in k-Group
- 树——populating-next-right-pointers-in-each-node(层序遍历变型)
- leetcode.222. Count Complete Tree Nodes
- 第一个Node.js应用
- Node.js的安装
- 今天使用babel遇到的一个错误
- 云监控中inode使用率监控具体作用是什么