UNPKG

funtool

Version:

A modern, efficient, and modular JavaScript utility library designed to enhance developer productivity.

97 lines (76 loc) โ€ข 3.2 kB
# ๐Ÿงฐ 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