@iot9x.com/ipc-utils
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

描述

九星云、九星小程序、九星配置工具所共用的库方法。

特殊说明

  1. 由于考虑到小程序,所以不要支持Buffer,所以Buffer部分全部使用Int8Array来代替。

如何使用

$ pnpm add @iot9x.com/ipc-utils
import {
    RegularUtil,
    ConversionUtil,
    dataFormatUtil
} from '@iot9x.com/ipc-utils'
// 检查是否为空
RegularUtil.isEmpty(null); // true
RegularUtil.isEmpty({}); // true
RegularUtil.isEmpty([]); // true

// 进制转换
ConversionUtil.hexToStr('31 32 33'); // 123
ConversionUtil.strToHex('123'); // 313233
ConversionUtil.strToHex('123', true); // 31 32 33

// 时间日期转换
dataFormatUtil.formatDate(Date.now()); // 2023-09-07 16:46:22
dataFormatUtil.formatHms(Date.now()); // 16:46:22

/@iot9x.com/ipc-utils/

    Package Sidebar

    Install

    npm i @iot9x.com/ipc-utils

    Weekly Downloads

    2

    Version

    0.1.5

    License

    MIT

    Unpacked Size

    332 kB

    Total Files

    81

    Last publish

    Collaborators

    • iot9x.com