Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datahub-import-json

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datahub-import-json

[![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Coverage status][codecov-image]][codecov-url] [![Dependency status][daviddm-image]][daviddm-url]

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

datahub-import-json

NPM version Build status Coverage status Dependency status

Upload all files below the mock file to DataHub

Installment

$ npm i datahub-import-json -g

Usage

$ datahub-import-json test-project -d /Users/xxx/mock/get --method GET
$ datahub-import-json test-project -d /Users/xxx/mock/post --method POST

Configuration

$  datahub-import-json projectName
paramdescriptiondefault
-sDataHub server addresshttp://127.0.0.1:5678
-dmock data directory path-
--mockSuffixset mock file suffix.json
--interfaceSuffixDataHub interface suffix, will replace mockSuffix.json
--replacePathWithDynamicreplace path with dynamic, goods/:id.json/_/
--mockRemoveSuffixremove mockRemoveSuffix, no repalce-
--methodDataHub interface methodALL

Examples

Import JSON interface

假设项目名为:test-project(建议与仓库名称保持一致) mock 数据文件件路径为:/Users/xxx/mock DataHub server 地址为:http://127.0.0.1:5678/ 想导入的 Mock 文件后缀为:.json 导入后的 Mock 接口后缀为:.html

$ datahub-import-json test-project -d /Users/xxx/mock --interfaceSuffix .html -s http://127.0.0.1:5678

Import js interface

假设项目名为:test-project(建议与仓库名称保持一致) mock 数据文件件路径为:/Users/xxx/mock DataHub server 地址为:http://127.0.0.1:5678/ 想导入的 Mock 文件路径为: /Users/xxx/mock/post/member/xxx.html/data.json /Users/xxx/mock/post/member/xxx.html/data.js 导入后的 Mock 接口路径为:/member/xxx.html

# post 请求
$ datahub-import-json test-project -d /Users/xxx/mock/post/ --mockRemoveSuffix /data.json --method POST -s http://127.0.0.1:5678

# get 请求
$ datahub-import-json test-project -d /Users/xxx/mock/get/ --mockRemoveSuffix /data.json --method GET -s http://127.0.0.1:5678

License

MIT

FAQs

Package last updated on 31 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc