wjp-utils
v0.1.1
Published
A small collection of reusable TypeScript utility functions
Readme
wjp-utils
一个小型的 TypeScript 工具库,方便在多个项目中复用常用方法。
快速开始
- 本地开发(先在库目录运行):
npm install
npm run build- 在另一个项目中本地使用(两种方式):
- 使用
npm link:
# 在本库目录
npm link
# 在目标项目目录
npm link wjp-utils- 或者在目标项目中直接使用相对路径安装(非发布场景):
npm install /path/to/wjp-utils用法示例(TypeScript):
import { debounce, deepClone, isEmpty, formatDate } from 'wjp-utils';
const f = debounce(() => console.log('called'), 300);
console.log(formatDate(new Date()));
const a = deepClone({ x: 1 });
console.log(isEmpty([]));发布到 npm:
- 登录:
npm login - 发布:
npm publish --access public
