npm i -D server_fn
Func | params | reture | Remarks |
---|---|---|---|
readFile | path: string | Promise | 读取文件内容 |
writeFile | path: string,data: string & NodeJS.ArrayBufferView | Promise | 写文件 |
rename | oldName: fs.PathLike,newName: fs.PathLike | Promise | 用于命名 |
isFile | path: string | Promise | 判断是文件 or 文件夹 |
readDir | path: string | Promise | 读取文件夹 |
Unlink | path: string | Promise | 删除文件 |
Cors | App: Application | void | 跨域 |
CreateToken | data: string& object & Buffer,secret: Jwt.Secret, Options?: Jwt.SignOptions & undefined | string | 生成 Token |
Puzzle | token: string,secretOrPublicKey: Jwt.Secret,options?: Jwt.VerifyOptions & undefined | string & object | 解谜 token |
encryption | data: any,saltOrRounds: string & number | Promise | bcrypt 散列加密数据 |
Untie | data: any, encrypted: string | Promise | 判断为加密和加密数据是否相等 |