foreign-country-node
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published
node的一些方法
closePort 关闭指定端口,此方法需要node14版本以上
/**
*   port 要关闭的端口
*   callback 关闭端口后的回调
*/
closePort(port: string, callback: Function);
getLocalIp 获取本机的本地ip地址
handleSafety express解决跨域
// 使用方式:
    handleSafety(app: Express)
saveBase64 任意文件base64保存成文件
// 使用方式:
    saveBase64({savePath: string , base64: string, hasHeader?: boolean});
    参数: savePath: 保存的地址(要包含文件名)
          fileBase64: 保存的文件base
          hasHeader: fileBase64是否包含头部,默认包含,我将会自动去除头部保存
    返回值: Promose<{
                code: 0, // 数字0标识成功,其他值表示失败
                data: null,
                msg: string       
           }>
fileToBase64 任意文件转base64数据
// 使用方式: 
    fileToBase64(filePath: string);
    参数: 读取的文件路径
    返回值:  Promose<{
                 code: 0, // 数字0标识成功,其他值表示失败
                 data: base64数据,
                 msg: string       
            }>

Package Sidebar

Install

npm i foreign-country-node

Weekly Downloads

7

Version

1.1.8

License

MIT

Unpacked Size

323 kB

Total Files

19

Last publish

Collaborators

  • foreign_country