Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 663 Bytes

README.md

File metadata and controls

46 lines (31 loc) · 663 Bytes

@mazp/util

Introduce

Integrate the functions commonly used in the project.

Install

npm i @mazp/util
yarn add @mazp/util
pnpm i @mazp/util

Usage

// ESM
import util from "@mazp/util";
util.formatTime(1671198728746)
// CJS
let util = require("@mazp/util");
util.formatTime(1671198728746)

API

formatTime

Transform timeStamp to a standard format like 2022-12-16-21-52-8.

declare function formatTime(time: number): string;

randomChars

Randomly generate your input parameter length, which is a [a-z][A-Z] composition string.

declare function randomChars(len: number): string;