{"id":20139269,"url":"https://github.com/lpreterite/datagent","last_synced_at":"2025-06-12T00:35:03.936Z","repository":{"id":39988575,"uuid":"109953034","full_name":"lpreterite/datagent","owner":"lpreterite","description":"一个用于模块化管理前端请求的工具","archived":false,"fork":false,"pushed_at":"2022-12-03T03:32:29.000Z","size":947,"stargazers_count":40,"open_issues_count":9,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T18:44:27.383Z","etag":null,"topics":["data-filtering","data-model","datagent","datamodel","fossa-status","model","restful"],"latest_commit_sha":null,"homepage":"https://lpreterite.github.io/datagent/","language":"JavaScript","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/lpreterite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T09:11:53.000Z","updated_at":"2023-04-12T06:23:55.000Z","dependencies_parsed_at":"2023-01-23T04:15:51.755Z","dependency_job_id":null,"html_url":"https://github.com/lpreterite/datagent","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/lpreterite/datagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fdatagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fdatagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fdatagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fdatagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpreterite","download_url":"https://codeload.github.com/lpreterite/datagent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fdatagent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259371303,"owners_count":22847556,"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":["data-filtering","data-model","datagent","datamodel","fossa-status","model","restful"],"created_at":"2024-11-13T21:44:36.683Z","updated_at":"2025-06-12T00:35:03.900Z","avatar_url":"https://github.com/lpreterite.png","language":"JavaScript","readme":"# Datagent\n\n[![npm version](https://img.shields.io/npm/v/datagent.svg)](https://www.npmjs.com/package/datagent)\n[![NPM downloads](http://img.shields.io/npm/dm/datagent.svg)](https://www.npmjs.com/package/datagent)\n[![build status](https://travis-ci.org/lpreterite/datagent.svg?branch=master)](https://travis-ci.org/lpreterite/datagent)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flpreterite%2Fdatagent.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flpreterite%2Fdatagent?ref=badge_shield)\n\n`Datagent`是一个用于模块化管理前端请求的工具，提供数据格式化、多服务源切换、语义化数据定义等功能。在 React,Vue,Angular 等现代 JavaScript 框架下，UI 显示均以数据驱动为中心，服务端提供的数据不是所有场合都能符合 UI 所需的结构。格式化数据、转义数据的代码往往不可避免的写在UI组件、业务逻辑代码或是页面等各个地方，导致冗余代码、逻辑复杂又难以维护等问题。面对这类情况可使用`Datagent`解决这类问题，不单单能统一调取后端服务和格式化从服务端获得的数据，定义一些处理后还能用于所有场景，让你更方便同步UI状态。\n\n![datagent-run](./docs/assets/images/datagent-run.png)\n\n\u003e 你可以马上尝试在`codepen`上的[例子](https://codepen.io/packy1980/pen/OEpNWW/)。\n\n## 安装\n\n```sh\nnpm install -S datagent\n//or\nyarn add datagent\n```\n\n目前正式版本为`1.x`，下面是安装`2.0`版本尝尝鲜。\n\n```sh\nnpm install -S datagent@next\n// or\nyarn add datagent@next\n```\n\n## 文档\n\n- [介绍](https://lpreterite.github.io/datagent/#/?id=介绍)\n  - [什么是 datagent.js](https://lpreterite.github.io/datagent/#/?id=什么是-datagentjs)\n  - [开始](https://lpreterite.github.io/datagent/#/?id=开始)\n  - [管理你的服务](https://lpreterite.github.io/datagent/#/?id=管理你的服务)\n  - [定义数据字段](https://lpreterite.github.io/datagent/#/?id=定义数据字段)\n  - [数据处理](https://lpreterite.github.io/datagent/#/?id=数据处理)\n  - [统一调用](https://lpreterite.github.io/datagent/#/?id=统一调用)\n- [深入了解](https://lpreterite.github.io/datagent/#/?id=深入了解)\n  - [远端与axios](https://lpreterite.github.io/datagent/#/?id=远端与axios)\n  - [自定义字段类型](https://lpreterite.github.io/datagent/#/?id=自定义字段类型)\n  - [方法与钩子](https://lpreterite.github.io/datagent/#/?id=方法与钩子)\n  - [自定义钩子](https://lpreterite.github.io/datagent/#/?id=自定义钩子)\n- [迁移](https://lpreterite.github.io/datagent/#/?id=迁移)\n  - [从 1.x 迁移](https://lpreterite.github.io/datagent/#/?id=从-1x-迁移)\n\n## License\n\nDatagent是根据[MIT协议](/LICENSE)的开源软件\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flpreterite%2Fdatagent.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Flpreterite%2Fdatagent?ref=badge_large)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fdatagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpreterite%2Fdatagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fdatagent/lists"}