Socket
Socket
Sign inDemoInstall

xmcommon

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xmcommon - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

27

lib/utils.js

@@ -507,3 +507,28 @@ const _ = require("lodash");

return undefined;
};
};
/**
* 原路径移动到新路径
* - 注:在windows下面,C盘或非同盘符的文件是改不了名的
* @param {String} paramOldFilename
* @param {String} paramNewFilename
* @return {ret: boolean, errInfo: string} 移动结果
* - ret = true 表示移动成功
* - ret = false 表示移动失败
* - errInfo 出错信息
*/
static async renameFile(paramOldFilename, paramNewFilename) {
let [error] = await this.WaitClassFunctionEx(fs, 'rename', paramOldFilename, paramNewFilename);
if (utils.isNull(error)) {
return {
ret: true,
errInfo: '',
};
} else {
return {
ret: false,
errInfo: `rename file fail: ${paramOldFilename}=>${paramNewFilename}: err=${JSON.stringify(error)}`,
}
}
}
/**

@@ -510,0 +535,0 @@ * 创建目录

2

package.json
{
"name": "xmcommon",
"version": "0.1.5",
"version": "0.1.6",
"description": "javascript common lib for es6",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -34,6 +34,7 @@ # xmcommon

## 0.1.5
## 0.1.5 - 0.1.6
- 2020-12-24
- \+ 增加fileExists判断文件或目录是否存在
- \* 修复makedirs存在的bug
- \+ 增加renameFile方法

@@ -40,0 +41,0 @@ ## 0.1.4

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc