Socket
Socket
Sign inDemoInstall

dpro

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dpro

data provider for testarmada


Version published
Weekly downloads
30
increased by66.67%
Maintainers
2
Weekly downloads
 
Created
Source

Data provider for testarmada

Build Status License: MIT codecov

file format

Provider should only support .js. .js support is to allow user generate some random data on the fly, like user registration scenario that requires fresh email account every time.

Each .js data file should return a json object.

supported files

   ${DPRO}.js          : main test data
   ${DPRO_INST}.js : (optional) extra data that only applies to certain instance

default file location

  ${REPO_ROOT}/config/data

  # file location can be changed by using
  ${DPRO_LOCATION}

file loading rules

basic

 # to only load from ${REPO_ROOT}/config/data/local.js
 DPRO=local ./node_modules/.bin/magellan --test xxxxx ......

 # to only load from ${REPO_ROOT}/config/data/prod-a.js
 DPRO=prod-a ./node_modules/.bin/magellan --test xxxxx ......

advantage

 # change file location to ${REPO_ROOT}/config/staging.js
 DPRO_LOCATION="./config/" DPRO=staging ./node_modules/.bin/magellan --test xxxxx ......

 # load both ${REPO_ROOT}/config/data/staging.js and ${REPO_ROOT}/config/data/staging-2.js
 # config in staging-2.js will be used if common config exists.
 DPRO=staging DPRO_INST=2 ./node_modules/.bin/magellan --test xxxxx ......

usage

 /** data file
 *{
 * "beijing": {
 *     "name": "Beijing",
 *     "country": "China",
 *     "description": "It is the most populous city in the China"
 *   },
 *   "timestamp": function () {
 *     return new Date().getTime();
 *  }
 *}
 */
 var td = require("dpro");

 console.log(td.beijing, td.beijing.description);
 console.log(td.timestamp());

License

Documentation in this project is licensed under Creative Commons Attribution 4.0 International License. Full details available at https://creativecommons.org/licenses/by/4.0

FAQs

Package last updated on 11 Feb 2019

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