{"id":21520876,"url":"https://github.com/hyhello/utils","last_synced_at":"2025-04-09T22:21:15.529Z","repository":{"id":39593502,"uuid":"426117857","full_name":"Hyhello/utils","owner":"Hyhello","description":"《常用前端工具函数库》已完结~","archived":false,"fork":false,"pushed_at":"2024-05-22T13:27:21.000Z","size":1112,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-22T13:41:08.400Z","etag":null,"topics":["browser","nodejs","tools","utils","utils-library"],"latest_commit_sha":null,"homepage":"https://Hyhello.github.io/utils/","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/Hyhello.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-09T06:34:53.000Z","updated_at":"2024-06-07T03:48:54.831Z","dependencies_parsed_at":"2024-06-07T03:48:39.774Z","dependency_job_id":"9e93449e-edf9-4d82-8b8e-20cd87bb0f37","html_url":"https://github.com/Hyhello/utils","commit_stats":{"total_commits":200,"total_committers":1,"mean_commits":200.0,"dds":0.0,"last_synced_commit":"6efef36a3504d8682c47d6ea9aef4c1ed015177c"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyhello%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyhello%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyhello%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hyhello%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hyhello","download_url":"https://codeload.github.com/Hyhello/utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120083,"owners_count":21050888,"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":["browser","nodejs","tools","utils","utils-library"],"created_at":"2024-11-24T01:04:36.646Z","updated_at":"2025-04-09T22:21:15.353Z","avatar_url":"https://github.com/Hyhello.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @hyhello/utils\n\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/toss/slash/blob/main/LICENSE) [![codecov](https://codecov.io/github/Hyhello/utils/graph/badge.svg?token=85BP7240GO)](https://codecov.io/github/Hyhello/utils) [![NPM badge](https://img.shields.io/npm/v/%40hyhello%2Futils?logo=npm)](https://www.npmjs.com/package/@hyhello/utils)\n\n### 介绍\n\n前端常用工具函数库。[查看在线文档](https://hyhello.github.io/utils/#/)\n\n### 安装教程\n\n```javascript\nnpm install @hyhello/utils\n```\n\nNote: add --save if you are using npm \u003c 5.0.0\n\n### 使用说明\n\nUse in a browser(CDN):\n\n```javascript\n\u003c!-- 引入库 --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@hyhello/utils/lib/index.min.js\"\u003e\u003c/script\u003e\nor\n\u003cscript src=\"https://unpkg.com/@hyhello/utils/lib/index.min.js\"\u003e\u003c/script\u003e\n```\n\nUse In Node.js:\n\n```javascript\n// Load the full build.\nvar utils = require('@hyhello/utils');\n\n// Load method categories.\nvar isArray = require('@hyhello/utils/lib/isArray');\nor\nvar { isArray } = require('@hyhello/utils');\n```\n\nUse In ES6:\n\n```javascript\n// Load the full build.\nimport utils from '@hyhello/utils';\n\n// Load method categories.\nimport isArray from '@hyhello/utils/lib/isArray';\nor\nimport { isArray } from '@hyhello/utils';\n```\n\n### 按需引入\n\n\u003e [!TIP]\n\u003e 从 `V1.12.0` 版本开始，如果您使用的构建工具支持 `Tree shaking`，您在使用 `@hyhello/utils` 库时将能够实现按需加载，无需进行任何额外配置。\n\n#### Usage in babel\n\n```javascript\nnpm install babel-plugin-import --save-dev\n```\n\nVia .babelrc or babel-loader.\n\n```javascript\n{\n  \"plugins\": [[\"import\", options]]\n}\n```\n\noptions can be object.\n\n```javascript\n{\n  \"libraryName\": \"@hyhello/utils\",\n  \"camel2DashComponentName\": false,  // default: true\n}\n```\n\n#### Usage in vite\n\n```javascript\nnpm install vite-plugin-imp --save-dev\n```\n\nVia vite.config.js.\n\n```javascript\nimport vitePluginImp from 'vite-plugin-img';\n\nexport default defineConfig({\n    plugins: [vitePluginImp(options)]\n});\n```\n\noptions can be object.\n\n```javascript\n{\n  \"libName\": \"@hyhello/utils\",\n  \"libDirectory\": \"lib\",\n  \"camel2DashComponentName\": false\n}\n```\n\n#### For example, the default behavior\n\n```javascript\nimport { isArray } from '@hyhello/utils';\n↓ ↓ ↓ ↓ ↓ ↓\nvar isArray = require('@hyhello/utils/lib/isArray');\n```\n\n### 支持情况\n\nTested in Chrome 74-75, Firefox 66-67, IE 9, Edge 18, Safari 11-12.\n\n注：采用 jest + jsdom 进行单元测试，报告如下：\n\n- Statements：98.96%\n- Branches：97.22%\n- Functions: 99.28%\n- Lines: 99.02%\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyhello%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyhello%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyhello%2Futils/lists"}