{"id":16977979,"url":"https://github.com/zivyangll/datahub-import-json","last_synced_at":"2026-05-01T12:31:39.333Z","repository":{"id":57211498,"uuid":"209259483","full_name":"zivyangll/datahub-import-json","owner":"zivyangll","description":"Upload all files below the mock file to DataHub","archived":false,"fork":false,"pushed_at":"2020-07-31T05:17:39.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T06:28:04.690Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zivyangll.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-18T08:37:17.000Z","updated_at":"2020-07-31T05:17:41.000Z","dependencies_parsed_at":"2022-08-30T12:30:10.975Z","dependency_job_id":null,"html_url":"https://github.com/zivyangll/datahub-import-json","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zivyangll/datahub-import-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivyangll%2Fdatahub-import-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivyangll%2Fdatahub-import-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivyangll%2Fdatahub-import-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivyangll%2Fdatahub-import-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zivyangll","download_url":"https://codeload.github.com/zivyangll/datahub-import-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zivyangll%2Fdatahub-import-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":[],"created_at":"2024-10-14T01:30:31.277Z","updated_at":"2026-05-01T12:31:39.304Z","avatar_url":"https://github.com/zivyangll.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datahub-import-json\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Coverage status][codecov-image]][codecov-url]\n[![Dependency status][daviddm-image]][daviddm-url]\n\n\u003e Upload all files below the mock file to DataHub\n\n## Installment\n\n```bash\n$ npm i datahub-import-json -g\n```\n\n## Usage\n\n```bash\n$ datahub-import-json test-project -d /Users/xxx/mock/get --method GET\n$ datahub-import-json test-project -d /Users/xxx/mock/post --method POST\n```\n\n## Configuration\n\n```bash\n$  datahub-import-json projectName\n```\n\n| param | description | default |\n| -- | -- | -- |\n| -s | DataHub server address | http://127.0.0.1:5678 |\n| -d | mock data directory path | - |\n| --mockSuffix | set mock file suffix | .json |\n| --interfaceSuffix | DataHub interface suffix, will replace mockSuffix  | .json |\n| --replacePathWithDynamic | replace path with dynamic, goods/:id.json | /_/ |\n| --mockRemoveSuffix | remove mockRemoveSuffix, no repalce | - |\n| --method | DataHub interface method | ALL |\n\n## Examples\n\n### Import JSON interface\n\n假设项目名为：test-project（建议与仓库名称保持一致）\nmock 数据文件件路径为：/Users/xxx/mock\nDataHub server 地址为：http://127.0.0.1:5678/\n想导入的 Mock 文件后缀为：.json\n导入后的 Mock 接口后缀为：.html\n\n```bash\n$ datahub-import-json test-project -d /Users/xxx/mock --interfaceSuffix .html -s http://127.0.0.1:5678\n```\n\n### Import js interface\n\n假设项目名为：test-project（建议与仓库名称保持一致）\nmock 数据文件件路径为：/Users/xxx/mock\nDataHub server 地址为：http://127.0.0.1:5678/\n想导入的 Mock 文件路径为：\n/Users/xxx/mock/post/member/xxx.html/data.json\n/Users/xxx/mock/post/member/xxx.html/data.js\n导入后的 Mock 接口路径为：/member/xxx.html\n\n```bash\n# post 请求\n$ datahub-import-json test-project -d /Users/xxx/mock/post/ --mockRemoveSuffix /data.json --method POST -s http://127.0.0.1:5678\n\n# get 请求\n$ datahub-import-json test-project -d /Users/xxx/mock/get/ --mockRemoveSuffix /data.json --method GET -s http://127.0.0.1:5678\n```\n\n---\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\n[npm-image]: https://img.shields.io/npm/v/datahub-import-json.svg?style=flat-square\u0026logo=npm\n[npm-url]: https://npmjs.org/package/datahub-import-json\n[travis-image]: https://img.shields.io/travis/zivyangll/datahub-import-json/master.svg?style=flat-square\u0026logo=travis\n[travis-url]: https://travis-ci.org/zivyangll/datahub-import-json\n[codecov-image]: https://img.shields.io/codecov/c/github/zivyangll/datahub-import-json/master.svg?style=flat-square\u0026logo=javascript\n[codecov-url]: https://codecov.io/gh/zivyangll/datahub-import-json\n[daviddm-image]: https://img.shields.io/david/zivyangll/datahub-import-json.svg?style=flat-square\n[daviddm-url]: https://david-dm.org/zivyangll/datahub-import-json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzivyangll%2Fdatahub-import-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzivyangll%2Fdatahub-import-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzivyangll%2Fdatahub-import-json/lists"}