funtool
Version:
A modern, efficient, and modular JavaScript utility library designed to enhance developer productivity.
97 lines (76 loc) โข 3.2 kB
Markdown
# ๐งฐ funtool - A Modern Modular Utility Library
English | [็ฎไฝไธญๆ](./README-zh_CN.md)
## ๐ 1. Introduction
`funtool` is a modern, modular JavaScript utility library designed to boost developer productivity. It offers well-organized modules, full TypeScript support, and an automated documentation system, making it suitable for multilingual projects, web applications, Node.js environments, and more. This project is a complete refactor of an older utility library, with versioning reset. Written in TypeScript, it features a cleaner structure, enhanced flexibility, and a more robust documentation system. `funtool` provides type-safe, reusable utility functions that significantly improve development efficiency for both JavaScript and TypeScript projects.
๐ **Documentation**
๐ [View Full Docs ยป](https://github.com/funinweb/funtool/docs)
## โจ 2. Features
+ ๐ **Boost Productivity**: Standardizes common logic to avoid reinventing the wheel, letting developers focus on core business logic.
+ ๐ **Modular Design**: Import only what you needโsuch as `array`, `object`, `string`, or `type` modulesโto keep bundle size minimal.
+ ๐ **Type Safety**: Built with TypeScript, offering comprehensive type declarations and seamless IDE integration for a smoother development experience.
+ ๐งช **Robust Test Coverage**: High test coverage ensures the library's reliability and stability.
+ ๐งฑ **Progressive Integration**: Use it fully or integrate specific modules on demand.
+ ๐ง **Automated Release Workflow**: Supports semantic versioning, changelog generation, pre-releases, dry runs, and more.
## โ๏ธ 3. Getting Started
### Installation
```bash
npm install funtool
# or
pnpm add funtool
```
## ๐ก 4. Usage Examples
### Type Checking
```ts
import { isString } from 'funtool/type';
import { isNumber } from 'funtool';
console.log(isNumber(1)); // โ
true
console.log(isString('hello')); // โ
true
```
### Regex Utilities
```ts
import { regex } from 'funtool';
const mobile = "13800138000";
console.log(
regex.checker(mobile).use('mobile').isValid()
); // โ
true
```
## ๐งฑ 5. Module Structure
```plain
src/
โโโ array/ # Array utilities
โโโ common/ # Common/shared utilities
โโโ function/ # Function-related utilities
โโโ object/ # Object utilities
โโโ regex/ # Regular expression utilities
โโโ string/ # String utilities
โโโ type/ # Type checking utilities
โโโ version.ts # Version information
โโโ index.ts # Main entry point
```
## ๐จ 6. Build & Release
### Start Development
```bash
npm run dev
```
### Build the Project
```bash
npm run build
```
### Run Tests
```bash
npm run test
```
### Generate Modules (No manual import needed)
```bash
npm run generate:module
```
### Release a New Version
```bash
pnpm run release
```
## ๐ 7. License
[MIT](https://opensource.org/licenses/MIT)
## ๐ 8. Docs
You can explore more advanced usage, module API reference, and examples in the official documentation:
๐ [Docs](https://funinweb.github.io/funtool/)
Copyright (c) 2019-present xiaoqiujun