JSPM

vtils

3.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1745
  • Score
    100M100P100Q110771F
  • License MIT

一个面向业务的 JavaScript/TypeScript 实用程序库。

Package Exports

  • vtils
  • vtils/date
  • vtils/package.json
  • vtils/react
  • vtils/types
  • vtils/utils
  • vtils/validator

Readme

vtils Test Coverage

一个面向业务的 JavaScript/TypeScript 实用程序库。

import { dedent } from 'vtils'

console.log(dedent`
  - Lodash
  - date-fns
  - react-use
  - type-fest
  - ts-essentials
  - yup
`)

特性

安装

# npm
npm i vtils

# yarn
yarn add vtils

# pnpm
pnpm add vtils

若在国内,推荐安装 tbify 使用淘宝镜像加速:

# npm
tnpm i vtils

# yarn
tyn add vtils

# pnpm
tpm add vtils

使用

NodeJS

// 基础工具库
import { wait, isNumber, EventBus, base64Encode } from 'vtils'

// 日期时间工具库
import { formatRelative, subDays, zhCN } from 'vtils/date'

// React 工具库
import { useClassName, useToggle, useScrollLoadMore } from 'vtils/react'

// 验证工具库
import { yup } from 'vtils/validator'

// 类型工具库
import { OmitStrict, LiteralUnion, PartialDeep } from 'vtils/types'

详细用法见文档:https://fjc0k.github.io/vtils/v3/

Deno

// 基础工具库
import {
  wait,
  isNumber,
  EventBus,
  base64Encode,
} from 'https://cdn.pika.dev/vtils@3.2.0'

// 类型工具库
import {
  OmitStrict,
  LiteralUnion,
  PartialDeep,
} from 'https://cdn.pika.dev/vtils@3.2.0/types'

许可

Jay Fong (c) MIT