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

nodejs 各种插件

时间:2017-10-31 20:07:19      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:detail   .com   com   run   dir   sync   console   filename   mongodb   

__dirname:全局变量,存储的是文件所在的文件目录
__filename:全局变量,存储的是文件名

代码:
dirname.js
console.log(__dirname);

运行node dirname.js
输出:D:\nodejs\src

代码:
dirname.js
console.log(__filename);
运行node dirname.js
输出:D:\nodejs\src\dirname.js //输出带路径的文件名

step.js学习
http://blog.csdn.net/zhangxin09/article/details/13018739

mongodb学习
http://www.runoob.com/nodejs/nodejs-mongodb.html

node插件:node-schedule
节点时间表
http://www.cnblogs.com/ajun/p/3548259.html
如果你想说,“在每个月的第三个星期二的每个小时的20点和50点运行这个功能,你会发现节点计划更适合你的需要。
const schedule = require(‘node-schedule‘);
var j = schedule .scheduleJob(‘42 * * * * *‘,function(){
console.log("又过去了一分钟")
});




nodejs之async异步编程


nodejs 各种插件

标签:detail   .com   com   run   dir   sync   console   filename   mongodb   

原文地址:http://www.cnblogs.com/learnings/p/7763028.html

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