nodejs随记04
生活随笔
收集整理的這篇文章主要介紹了
nodejs随记04
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
aes加密
資料
- 簡介;
- 例子;
process
- 改變工作目錄: process.chdir(path);
路徑計算
- 例子
獲取調用執行所在文件地址
function getCaller() {try {var err = new Error();var callerfile;var currentfile;var origPrepareStackTrace = Error.prepareStackTrace;Error.prepareStackTrace = function (err, stack) { return stack; };currentfile = err.stack.shift().getFileName();Error.prepareStackTrace = origPrepareStackTrace;while (err.stack.length) {callerfile = err.stack.shift().getFileName();if(currentfile !== callerfile) return callerfile;}} catch (err) {}return undefined; };- 相關: a, b, c;
計算運行時間
console.time('test'); ..... console.timeEnd('test');轉載于:https://www.cnblogs.com/jinkspeng/p/5066846.html
總結
以上是生活随笔為你收集整理的nodejs随记04的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: bzoj4013: [HNOI2015]
- 下一篇: js获取checkbox多选表单