{"id":19345568,"url":"https://github.com/future-team/gfs-mock","last_synced_at":"2026-05-08T16:34:03.956Z","repository":{"id":70589108,"uuid":"76618474","full_name":"future-team/gfs-mock","owner":"future-team","description":"mock for method decorator","archived":false,"fork":false,"pushed_at":"2017-06-30T03:30:00.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-06T21:18:04.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/future-team.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-16T03:37:40.000Z","updated_at":"2016-12-20T03:51:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"cca332c3-4d1d-4bb5-b3e3-3419290460b1","html_url":"https://github.com/future-team/gfs-mock","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"9533d13ef3f83e45d35831b9e014eb6adbc25b71"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fgfs-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fgfs-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fgfs-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/future-team%2Fgfs-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/future-team","download_url":"https://codeload.github.com/future-team/gfs-mock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240452185,"owners_count":19803581,"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":[],"created_at":"2024-11-10T04:07:07.386Z","updated_at":"2026-05-08T16:33:58.914Z","avatar_url":"https://github.com/future-team.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gfs-mock\n\n提供对本地环境的校验并给出对应环境请求链接！\n\n## 安装\n\n```\n\n\tnpm install gfs-mock --save\n```\n\n## 使用\n\n`new Mock([options,])` \n\n```\n\n\tvar mock = new Mock({\n\t\tmockdir:'mocks', //可选 \n\t\tsuffix:'.json',  //可选\n\t\tisMock:false,\t//可选\n\t\tlocalUrlToLowerCase:true\t//可选\n\t});\n\t\n\t//得到处理后的url\n\tmock.getUrl('http://www.dianping.com/test/test.action');   //本地环境将返回127.0.0.1/mocks/test/test.json\n\t\n```\n\n## 例子\n\n```\n\n\timport Mock from 'gfs-mock';\n    import Fetch from 'gfs-fetch';\n    \n    \n    let fetch = new Fetch(new Mock() );\n    \n    fetch.run('https://e.dianping.com/actions/test/ajax.action?debug=1\u0026_cid=1024').then(function(data){\n    \n        document.getElementById('root').innerHTML = data.description;\n    });\n    \n    //得到结果\n    //[page.html] 本地mock数据获取成功！\n    //console.log    [mock data] 创建本地数据链接成功！ http://127.0.0.1:8081/mocks/actions/test/ajax.json\n```\n\n## Options 字段说明\n\n`mockdir`\t本地mock根路径，默认值为 'mocks'\n\n`suffix`\t本地文件后缀名，默认值为 '.json'\n\n`isMock`\t强制走本地数据，默认值为 'false'\n\n`localUrlToLowerCase`\t本地mock文件统一小写命名，默认值为 'true'\n\n## Command\n\n```\n\t#测试\t\n\tnpm run test\t\n\t#打包\t\n\tnpm run build\t\n\t#例子演示\t\n\tnpm start\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Fgfs-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuture-team%2Fgfs-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuture-team%2Fgfs-mock/lists"}