OSDN Git Service

Regular updates
[twpd/master.git] / nodejs-path.md
1 ---
2 title: path
3 category: Node.js
4 ---
5
6     fs.realpath('/etc/passwd', function(err, path) { /* "/private/etc/passwd" */ 
7     });
8
9     dir = path.join('etc', 'passwd');
10     dir = path.resolve('/etc', 'passwd', '..', 'var');
11
12     path.dirname('/etc/passwd')       //=> "/etc"
13     path.basename('/etc/passwd')      //=> "passwd"
14     path.basename('/etc/rc.d', '.d')  //=> "rc"
15
16 ### References
17
18 - http://nodejs.org/api/path.html