config.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env node
  2. "use strict";
  3. Object.defineProperty(exports, "__esModule", { value: true });
  4. const minimist = require("minimist");
  5. const opts = {
  6. boolean: ['help', 'fork'],
  7. string: ['port', 'seleniumAddress', 'highlightDelay', 'logDir'],
  8. alias: {
  9. help: ['h'],
  10. port: ['p'],
  11. seleniumAddress: ['s'],
  12. },
  13. default: {
  14. port: process.env.BP_PORT || 0,
  15. seleniumAddress: process.env.BP_SELENIUM_ADDRESS || 'http://localhost:4444/wd/hub',
  16. }
  17. };
  18. function processArgs(argv) {
  19. return minimist(argv, opts);
  20. }
  21. exports.processArgs = processArgs;
  22. function printHelp() {
  23. console.log(`
  24. Usage: blocking-proxy <options>
  25. Options:
  26. --help, -h Show help.
  27. --port, -p The port to listen on. If unset, will choose a random free port.
  28. --fork Start in fork mode. BlockingProxy will use process.send() to communicate
  29. with the parent process.
  30. --selenumAddress, -s The address of the selenium remote server to proxy.
  31. --highlightDelay If specified, will highlight elements before interacting with them and
  32. wait the specified amount of time (in ms) before allowing WebDriver
  33. to continue.
  34. --logDir If specified, will create a log of WebDriver commands in this directory.
  35. --rootElement Element housing ng-app, if not html or body.
  36. `);
  37. }
  38. exports.printHelp = printHelp;
  39. //# sourceMappingURL=config.js.map