@bnfe/common-utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

@bnfe/common-utils

这是一个通用的utils包 你可以在任何能运行javascript的地方使用

安装

pnpm install @bnfe/common-utils -S

使用

1. 在 Vue/React 中使用

import { getType } from "@bnfe/common-utils";

const type = getType("str");

console.log(type); // -> string

2. 在 h5 / browser 中使用

复制dist文件夹下的common-utils.umd.js文件 引入现有的项目中

<script src="./script/common-utils.umd.js"></script>

<script>
  const { getType } = utilsCommon

  const type = getType('str')

  const type = getType('str')

  console.log(type) // -> string
</script>

3. 在 node 中使用


3.1 ESM模块规范

import { getType } from "@bnfe/common-utils";

3.2 CJS模块规范

const { getType } = require("@bnfe/common-utils");

Readme

Keywords

none

Package Sidebar

Install

npm i @bnfe/common-utils

Weekly Downloads

1

Version

1.2.1

License

ISC

Unpacked Size

12.9 kB

Total Files

21

Last publish

Collaborators

  • wuyupei
  • topb25
  • dujunhui15
  • whh2828
  • zyh941109