{"id":20964669,"url":"https://github.com/moyus/mobot","last_synced_at":"2025-10-05T21:42:05.310Z","repository":{"id":57128280,"uuid":"163255155","full_name":"moyus/mobot","owner":"moyus","description":"JS/CSS移动端LocalStorage缓存资源方案","archived":false,"fork":false,"pushed_at":"2019-01-28T15:53:40.000Z","size":37,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-19T17:36:46.225Z","etag":null,"topics":["cache","css","js","localstorage","mobile"],"latest_commit_sha":null,"homepage":"","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/moyus.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":null,"support":null}},"created_at":"2018-12-27T06:17:21.000Z","updated_at":"2023-03-12T09:02:30.000Z","dependencies_parsed_at":"2022-08-26T18:22:13.772Z","dependency_job_id":null,"html_url":"https://github.com/moyus/mobot","commit_stats":null,"previous_names":["moyus/bucket.js"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/moyus/mobot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moyus%2Fmobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moyus%2Fmobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moyus%2Fmobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moyus%2Fmobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moyus","download_url":"https://codeload.github.com/moyus/mobot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moyus%2Fmobot/sbom","scorecard":{"id":661888,"data":{"date":"2025-08-11","repo":{"name":"github.com/moyus/mobot","commit":"1c2f81121902ae1c0d649f33a4e47d4b2a9f4301"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T16:27:14.625Z","repository_id":57128280,"created_at":"2025-08-21T16:27:14.625Z","updated_at":"2025-08-21T16:27:14.625Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278526242,"owners_count":26001325,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cache","css","js","localstorage","mobile"],"created_at":"2024-11-19T02:57:02.532Z","updated_at":"2025-10-05T21:42:05.268Z","avatar_url":"https://github.com/moyus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"160\" height=\"50\" src=\"https://github.com/moyus/mobot/raw/master/logo.svg?sanitize=true\" alt=\"mobot.js\" /\u003e\n  \u003cp\u003e移动端LocalStorage缓存资源方案\u003c/p\u003e\n\u003c/div\u003e\n\n## 安装\n```bash\nnpm install mobot\n```\n\n## 使用\n```javascript\nmobot.timeout = 10000; // 请求超时10s\nmobot.prefix = 'mobot-'; // LocalStorage前缀\nmobot.expire = 24 * 7; // 7天的缓存时间\nmobot.require([\n  {\n    url: 'https://www.xxx.xxx/static/styles.123.css',\n    key: 'styles',\n    unique: '123',\n    cache: true\n  },\n  {\n    url: 'https://www.xxx.xxx/static/vendors.456.js',\n    key: 'vendors',\n    unique: '456',\n    cache: true\n  },\n  {\n    url: 'https://www.xxx.xxx/static/app.789.js',\n    key: 'app',\n    unique: '789',\n    cache: true\n  }\n], function (err, resources) {\n  // 所有资源均已加载并按顺序插入到了head中\n});\n\n// 获取本地缓存资源\nmobot.get('app');\n// {\n//   url: string       // 资源地址\n//   key: string       // 索引名\n//   unique: string    // hash值\n//   content: string   // 资源内容\n//   type: string      // 资源类型\n//   stamp: number     // 什么时候缓存的\n//   expire: number    // 多久之后过期\n// }\n\n// 删除本地缓存资源\nmobot.remove('vendors')\n\n// 清空本地所有缓存资源\nmobot.clear()\n```\n\n## 相关讨论\n[https://www.zhihu.com/question/28467444](https://www.zhihu.com/question/28467444)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoyus%2Fmobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoyus%2Fmobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoyus%2Fmobot/lists"}