🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

foreign-country-node

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foreign-country-node

``` /** * port 要关闭的端口 * callback 关闭端口后的回调 */ closePort(port: string, callback: Function); ```

latest
npmnpm
Version
1.1.8
Version published
Weekly downloads
26
13.04%
Maintainers
1
Weekly downloads
 
Created
Source
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       
            }>

Keywords

node关闭端口

FAQs

Package last updated on 07 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts