{"id":29191271,"url":"https://github.com/ryanuo/utils","last_synced_at":"2025-07-02T00:32:52.995Z","repository":{"id":292787021,"uuid":"981516044","full_name":"ryanuo/utils","owner":"ryanuo","description":" Provide a variety of practical utility functions, covering multiple fields such as algorithms, browser operations, network requests, etc.","archived":false,"fork":false,"pushed_at":"2025-06-09T07:23:09.000Z","size":559,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T08:31:32.772Z","etag":null,"topics":["utils"],"latest_commit_sha":null,"homepage":"https://utils.ryanuo.cc","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["ryanuo"],"opencollective":"ryan55"}},"created_at":"2025-05-11T09:39:58.000Z","updated_at":"2025-06-09T07:23:07.000Z","dependencies_parsed_at":"2025-05-12T06:37:13.779Z","dependency_job_id":"2367fe63-d220-4d95-817a-a0a8bb1f6750","html_url":"https://github.com/ryanuo/utils","commit_stats":null,"previous_names":["ryanuo/utils"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/ryanuo/utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanuo%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanuo%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanuo%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanuo%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanuo","download_url":"https://codeload.github.com/ryanuo/utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanuo%2Futils/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263056049,"owners_count":23406805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["utils"],"created_at":"2025-07-02T00:31:05.850Z","updated_at":"2025-07-02T00:32:52.976Z","avatar_url":"https://github.com/ryanuo.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ryanuo","ryan55"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/ryanuo/utils/main/docs/public/utils.svg\" style=\"width:100px;\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e@ryanuo/utils\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.com/package/@ryanuo/utils\" style=\"text-decoration: none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@ryanuo/utils?style=flat\u0026colorA=080f12\u0026colorB=1fa669\" alt=\"npm version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.com/package/@ryanuo/utils\" style=\"text-decoration: none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/@ryanuo/utils?style=flat\u0026colorA=080f12\u0026colorB=1fa669\" alt=\"npm downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@ryanuo/utils\" style=\"text-decoration: none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@ryanuo/utils?style=flat\u0026colorA=080f12\u0026colorB=1fa669\u0026label=minzip\" alt=\"bundle size\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.jsdocs.io/package/@ryanuo/utils\" style=\"text-decoration: none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/jsdocs-reference-080f12?style=flat\u0026colorA=080f12\u0026colorB=1fa669\" alt=\"JSDocs\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ryanuo/utils/blob/main/LICENSE\" style=\"text-decoration: none;\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/ryanuo/utils.svg?style=flat\u0026colorA=080f12\u0026colorB=1fa669\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Overview\n\n`@ryanuo/utils` is a powerful utility library that provides a variety of practical helper functions across multiple domains such as algorithms, browser operations, network requests, and more, aiming to boost development efficiency.\n- **AI Module**: Provides utility functions related to artificial intelligence to aid AI development.\n- **Algorithm Module**: Contains implementations of commonly used algorithms for quick integration.\n- **Browser Module**: Offers utility functions for browser environments to simplify DOM manipulation and event handling.\n- **Node.js Module**: Specifically designed utility functions for Node.js environment to enhance productivity.\n- **Finance Module**: Includes utility functions relevant to financial calculations suitable for finance-related scenarios.\n- **Graphics Module**: Provides utility functions related to graphics processing ideal for image and graphic development.\n- **Network Module**: Contains utility functions for network requests and data processing to streamline network operations.\n- **Common Module**: Provides general-purpose foundational utility functions applicable in various scenarios.\n\n## Installation\n\nInstall using npm:\n\n```bash\nnpm install @ryanuo/utils\n```\n\nInstall using pnpm:\n\n```bash\npnpm add @ryanuo/utils\n```\n\nInstall using yarn:\n\n```bash\nyarn add @ryanuo/utils\n```\n\n## Usage\n\n```ts\n// Module to be used in both browser and Node environments\nimport { /* shared utility functions */ } from '@ryanuo/utils'\n\n// Module to be used only in Node environment\n// Note: This module includes functionalities specifically designed for Node, such as file operations, network requests, etc.\nimport { /* Node-specific utility functions */ } from '@ryanuo/utils/node'\n```\n\n## Available Utilities\n\nBelow are the module categories available in the utility library:\n\u003c!-- auto utils start --\u003e\n| Type | Function List |\n|------|----------------|\n| [Ai](https://utils.ryanuo.cc/api/ai/) | [linearRegression()](https://utils.ryanuo.cc/api/ai/functions/linearRegression.html)；[normalizeData()](https://utils.ryanuo.cc/api/ai/functions/normalizeData.html)；[normalizeMinMax()](https://utils.ryanuo.cc/api/ai/functions/normalizeMinMax.html) |\n| [Algorithm](https://utils.ryanuo.cc/api/algorithm/) | [binarySearch()](https://utils.ryanuo.cc/api/algorithm/functions/binarySearch.html)；[bubbleSort()](https://utils.ryanuo.cc/api/algorithm/functions/bubbleSort.html)；[fibonacciDP()](https://utils.ryanuo.cc/api/algorithm/functions/fibonacciDP.html)；[fibonacciRecursive()](https://utils.ryanuo.cc/api/algorithm/functions/fibonacciRecursive.html)；[isPrime()](https://utils.ryanuo.cc/api/algorithm/functions/isPrime.html)；[quickSort()](https://utils.ryanuo.cc/api/algorithm/functions/quickSort.html) |\n| [Browser](https://utils.ryanuo.cc/api/browser/) | [copyToClipboard()](https://utils.ryanuo.cc/api/browser/functions/copyToClipboard.html)；[enterFullScreen()](https://utils.ryanuo.cc/api/browser/functions/enterFullScreen.html)；[isMobile()](https://utils.ryanuo.cc/api/browser/functions/isMobile.html)；[manageClasses()](https://utils.ryanuo.cc/api/browser/functions/manageClasses.html)；[onceEventListener()](https://utils.ryanuo.cc/api/browser/functions/onceEventListener.html)；[downloadFile()](https://utils.ryanuo.cc/api/browser/functions/downloadFile.html)；[safeStorage()](https://utils.ryanuo.cc/api/browser/variables/safeStorage.html)；[getUrlParams()](https://utils.ryanuo.cc/api/browser/functions/getUrlParams.html)；[getUrlParamsString()](https://utils.ryanuo.cc/api/browser/functions/getUrlParamsString.html) |\n| [Common](https://utils.ryanuo.cc/api/common/) | [dateFormat()](https://utils.ryanuo.cc/api/common/functions/dateFormat.html)；[dayjs()](https://utils.ryanuo.cc/api/common/variables/dayjs.html)；[curry()](https://utils.ryanuo.cc/api/common/functions/curry.html)；[debounce()](https://utils.ryanuo.cc/api/common/functions/debounce.html)；[getUuid()](https://utils.ryanuo.cc/api/common/functions/getUuid.html)；[safeJSONParse()](https://utils.ryanuo.cc/api/common/functions/safeJSONParse.html)；[throttle()](https://utils.ryanuo.cc/api/common/functions/throttle.html)；[isBoolean()](https://utils.ryanuo.cc/api/common/functions/isBoolean.html)；[isBrowser()](https://utils.ryanuo.cc/api/common/functions/isBrowser.html)；[isDate()](https://utils.ryanuo.cc/api/common/functions/isDate.html)；[isEmptyObject()](https://utils.ryanuo.cc/api/common/functions/isEmptyObject.html)；[isFunction()](https://utils.ryanuo.cc/api/common/functions/isFunction.html)；[isNull()](https://utils.ryanuo.cc/api/common/functions/isNull.html)；[isNumber()](https://utils.ryanuo.cc/api/common/functions/isNumber.html)；[isObject()](https://utils.ryanuo.cc/api/common/functions/isObject.html)；[isRegExp()](https://utils.ryanuo.cc/api/common/functions/isRegExp.html)；[isString()](https://utils.ryanuo.cc/api/common/functions/isString.html)；[isUndefined()](https://utils.ryanuo.cc/api/common/functions/isUndefined.html)；[deepClone()](https://utils.ryanuo.cc/api/common/functions/deepClone.html)；[getTypeName()](https://utils.ryanuo.cc/api/common/functions/getTypeName.html)；[numberToFixed()](https://utils.ryanuo.cc/api/common/functions/numberToFixed.html)；[toString()](https://utils.ryanuo.cc/api/common/functions/toString.html) |\n| [Finance](https://utils.ryanuo.cc/api/finance/) | [formatCurrency()](https://utils.ryanuo.cc/api/finance/functions/formatCurrency.html)；[calculatePercentage()](https://utils.ryanuo.cc/api/finance/functions/calculatePercentage.html)；[compare()](https://utils.ryanuo.cc/api/finance/functions/compare.html)；[preciseAdd()](https://utils.ryanuo.cc/api/finance/functions/preciseAdd.html)；[preciseDiv()](https://utils.ryanuo.cc/api/finance/functions/preciseDiv.html)；[preciseMul()](https://utils.ryanuo.cc/api/finance/functions/preciseMul.html)；[preciseSub()](https://utils.ryanuo.cc/api/finance/functions/preciseSub.html)；[roundTo()](https://utils.ryanuo.cc/api/finance/functions/roundTo.html)；[decimal()](https://utils.ryanuo.cc/api/finance/variables/decimal.html) |\n| [Graphics](https://utils.ryanuo.cc/api/graphics/) | [hexToRgba()](https://utils.ryanuo.cc/api/graphics/functions/hexToRgba.html)；[lerpColor()](https://utils.ryanuo.cc/api/graphics/functions/lerpColor.html)；[rgbaToHex()](https://utils.ryanuo.cc/api/graphics/functions/rgbaToHex.html) |\n| [Network](https://utils.ryanuo.cc/api/network/) | [checkNetworkStatus()](https://utils.ryanuo.cc/api/network/functions/checkNetworkStatus.html)；[fetchWithTimeout()](https://utils.ryanuo.cc/api/network/functions/fetchWithTimeout.html)；[getClientIP()](https://utils.ryanuo.cc/api/network/functions/getClientIP.html)；[getIndexedDBCache()](https://utils.ryanuo.cc/api/network/functions/getIndexedDBCache.html)；[parallelRequests()](https://utils.ryanuo.cc/api/network/functions/parallelRequests.html)；[request()](https://utils.ryanuo.cc/api/network/functions/request.html) |\n| [Node](https://utils.ryanuo.cc/api/node/) | [logger()](https://utils.ryanuo.cc/api/node/variables/logger.html)；[mkdirp()](https://utils.ryanuo.cc/api/node/functions/mkdirp.html)；[rmrf()](https://utils.ryanuo.cc/api/node/functions/rmrf.html) |\n\u003c!-- auto utils end --\u003e\n\n## License\n\n[MIT](https://github.com/ryanuo/utils/blob/main/LICENSE) License © 2023-PRESENT [ryanuo](https://github.com/ryanuo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanuo%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanuo%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanuo%2Futils/lists"}