- 博客(1)
- 收藏
- 关注
原创 node.js 中使用__dirname解决fs模块中的查询路径问题
const fs = require(‘fs’) const path = require(‘path’) const abspath = __dirname + ‘files/1.txt’ console.log(abspath); // const abspath = path.join(__dirname, ‘files/1.txt’) // 今后,只要涉及到路径的拼接,推荐大家使用...
2018-07-28 19:54:30 1861
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人