{"id":17787362,"url":"https://github.com/simon-he95/lazy-js-utils","last_synced_at":"2025-04-09T05:10:49.289Z","repository":{"id":37756503,"uuid":"501897067","full_name":"Simon-He95/lazy-js-utils","owner":"Simon-He95","description":"工具函数库 | Tool library","archived":false,"fork":false,"pushed_at":"2025-04-05T05:04:26.000Z","size":3672,"stargazers_count":71,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T04:44:12.496Z","etag":null,"topics":["lazy-js-utils","tool-library","tools-function","utils","utils-lib"],"latest_commit_sha":null,"homepage":"https://lazy-js-utils-docs.netlify.app/","language":"Vue","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/Simon-He95.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},"funding":{"github":"Simon-He95","custom":["https://github.com/Simon-He95/sponsor"]}},"created_at":"2022-06-10T04:19:21.000Z","updated_at":"2025-04-05T05:04:28.000Z","dependencies_parsed_at":"2024-06-11T11:16:50.572Z","dependency_job_id":"2e33aef5-2d7d-4a8f-a4ed-425c70287448","html_url":"https://github.com/Simon-He95/lazy-js-utils","commit_stats":{"total_commits":1022,"total_committers":8,"mean_commits":127.75,"dds":0.5949119373776908,"last_synced_commit":"cc69edb2880939145c4b154fa75ad8bd9983ce9e"},"previous_names":["simon-he95/simon-js-tool"],"tags_count":309,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simon-He95%2Flazy-js-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simon-He95%2Flazy-js-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simon-He95%2Flazy-js-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simon-He95%2Flazy-js-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simon-He95","download_url":"https://codeload.github.com/Simon-He95/lazy-js-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"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":["lazy-js-utils","tool-library","tools-function","utils","utils-lib"],"created_at":"2024-10-27T10:10:19.889Z","updated_at":"2025-04-09T05:10:49.271Z","avatar_url":"https://github.com/Simon-He95.png","language":"Vue","funding_links":["https://github.com/sponsors/Simon-He95","https://github.com/Simon-He95/sponsor"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg height=\"200\" src=\"./assets/kv.png\" alt=\"lazy-js-utils\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://www.npmjs.com/package/lazy-js-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/lazy-js-utils?color=3fb883\u0026amp;label=\" alt=\"NPM version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/lazy-js-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/lazy-js-utils?style=social\" alt=\"NPM version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Simon-He95/lazy-js-utils\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/Simon-He95/lazy-js-utils?style=social\" alt=\"NPM version\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://lazy-js-utils-docs.netlify.app/\"\u003e🖥 文档\u003c/a\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e \u003ca href=\"./README_en.md\"\u003eEnglish\u003c/a\u003e | 简体中文\u003c/p\u003e\n\n目前整理了\u003cstrong\u003e200 左右\u003c/strong\u003e的常用函数,还在持续更新中...,你的认可是对我最大的鼓励 :hearts:\n\n## :100: 亮点\n\n- 纯 js 的工具函数,可使用在任何可执行 js 的环境\n- 大量减少`ref\u003cHTMLElement\u003e` 和 `onMounted`的使用，可以 script 标签直接调用\n- 所有的副作用函数都能返回一个 stop 函数，可以在任意地方停止事件的执行，并且在页面销毁时自动销毁事件\n- api 设计简单、实用、类型友好\n\n## \u0026#x270B; 例子\n\n```ts\nimport {\n  insertElement,\n  useEventListener,\n  useMutationObserver,\n  useRaf,\n} from 'lazy-js-utils'\n\n// 监听container的变化, 你不再需要const container = ref\u003cHTMLElement\u003e\nuseMutationObserver('#container', (mutationsList, observer) =\u003e {\n  console.log(mutationsList)\n})\n// requestAnimationFrame\nuseRaf(\n  (timestamp) =\u003e {\n    // 每帧相隔1s执行\n    console.log('animationFrame', timestamp)\n  },\n  {\n    delta: 1000,\n    autoStop: true /* 只执行一次后被销毁 */\n  }\n)\n// 注册事件\nuseEventListener('#container', 'click', () =\u003e {\n  console.log('click')\n})\n// 插入元素\ninsertElement('#container', '.content')\n// 删除元素\nremoveElement('.content')\n```\n\n```html\n\u003cdiv id=\"container\"\u003e\u003c/div\u003e\n\u003cdiv class=\"content\"\u003ehello world\u003c/div\u003e\n```\n\n## :book: 使用说明\n\n```bash\nnpm i lazy-js-utils // 安装\n\nimport {\n  deepCompare\n } from 'lazy-js-utils' // 按需引入\n\n```\n\n## 👉 [文档](https://lazy-js-utils-docs.netlify.app/)\n\n## :coffee:\n\n[请我喝一杯咖啡](https://github.com/Simon-He95/sponsor)\n\n## License\n\n[MIT](./license)\n\n## GitHub 地址\n\n[欢迎 PR](https://github.com/Simon-He95/lazy-js-utils)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/Simon-He95/lazy-js-utils@master/.github-contributors/Simon-He95_lazy-js-utils.svg\"\u003e\n    \u003cimg src=\"https://cdn.jsdelivr.net/gh/Simon-He95/lazy-js-utils@master/.github-contributors/Simon-He95_lazy-js-utils.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-he95%2Flazy-js-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimon-he95%2Flazy-js-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimon-he95%2Flazy-js-utils/lists"}