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;
};
计算运行时间
console.time('test');
.....
console.timeEnd('test');