介绍
工具库模块。
使用方法
javascript
const Utils = require('ee-core/utils');API列表
getPackage()
获取项目根目录package.json内容。
getMAC(iface)
- iface [String] - 如果提供,则将MAC地址提取限制到此接口
获取一个正确的MAC地址
isMAC(macAddress)
- macAddress [String] - mac address
是否为有效的Mac地址
machineId()
- original [Boolean] - If true return original value of machine id, otherwise return hashed value (sha-256), default: false
(异步)获取 machine id,返回 Promise 对象。
machineIdSync()
- original [Boolean] - If true return original value of machine id, otherwise return hashed value (sha-256), default: false
(同步)获取 machine id。
isFileProtocol()
是否为 file:// 协议
isWebProtocol()
是否为 http:// | https:// 协议
is
utils/is 模块
