1.0.6 • Published 2 years ago

alanngai-node-helper v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Functions

getAllFileNameFromDir(dirPath) ⇒ array

获取文件夹下所有文件名

Kind: global function
Returns: array - 文件名列表

ParamTypeDescription
dirPathstring文件夹路径

copyFile(from, to)

复制文件

Kind: global function

ParamTypeDescription
fromstring复制文件路径
tostring目标文件路径

getProcessParams() ⇒ array

获取 node 程序参数

Kind: global function
Returns: array - 参数列表

getFileExt(fileName) ⇒ string

Kind: global function
Returns: string - 返回文件名后缀

ParamTypeDescription
fileNamestring带后缀的文件名

getFileNameOnly(filePath)

通过文件路径仅获取文件名

Kind: global function

ParamTypeDescription
filePathstring文件绝对路径

runShellCommand(command, shell)

执行 shell 命令

Kind: global function

ParamTypeDescription
commandstring命令
shellstring选填,shell类型

isSameFile(pathA, pathB)

比对两个文件(如json)(格式和内容)是否全等

Kind: global function

ParamTypeDescription
pathAstring文件A,绝对路径
pathBstring文件B,绝对路径

isDir(path) ⇒ boolean

判断是否文件夹

Kind: global function
Returns: boolean - 是否为文件夹

ParamTypeDescription
pathstring文件夹绝对路径

getSystemName() ⇒ string

获取操作系统名,可能是 MacOS、Linux、Windows

Kind: global function
Returns: string - 系统名

createDirIfNonExist(filepath) ⇒ boolean

如果不存在则创建文件夹

Kind: global function
Returns: boolean - 完成则返回true

ParamTypeDescription
filepathstring文件夹绝对路径

normalizePath(filepath) ⇒ string

把路径格式化为 xx/xx,主要是为了处理 win系统上的差异

Kind: global function
Returns: string - 格式化后的路径

ParamTypeDescription
filepathstring文件路径
1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago