码迷,mamicode.com
首页 > Web开发 > 详细

nodejs 2017

时间:2017-03-22 00:52:33      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:uil   div   index   UI   ports   返回   dir   mod   合成   

a.js

// 运行  node a.js

var path = require(‘path‘);
console.log(path.resolve()); // 不传参,会返回当前文件的绝对路径 
console.log(__dirname);  // 也是当前文件的绝对路径

console.log(path.resolve(__dirname));
console.log(path.resolve(__dirname,‘../dist/index.html‘)); 
// 路径组合成一个绝对路径  


var b = require(‘./b‘);
console.log(‘b.env: ‘ + b.build.env)
console.log(‘b.index: ‘ + b.build.index)

b.js

var path = require(‘path‘)
module.exports = {
    build:{
        index: path.resolve(__dirname,‘../dist/index.html‘),
        env: ‘testOne‘
    }
}

 

nodejs 2017

标签:uil   div   index   UI   ports   返回   dir   mod   合成   

原文地址:http://www.cnblogs.com/gyz418/p/6597274.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!