Comparing version 0.1.0 to 0.1.1
@@ -9,3 +9,3 @@ #!/usr/bin/env node | ||
.option("-c, --config <path>", "Absolute path to config file.", __dirname + "/../config.json") | ||
.option("-O, --show-output", "Enable console logging. Default is false.") | ||
.option("-O, --show-output", "Enable console logging. Default is true.", true) | ||
.option("-p, --port <port>", "Port that the http mock server will use. Default is 8888.", "8888") | ||
@@ -12,0 +12,0 @@ .parse(process.argv); |
var express = require('express'), | ||
_ = require("underscore"), | ||
path = require("path"), | ||
apiMocker = {}, | ||
@@ -30,5 +31,9 @@ defaults = { | ||
return apiMocker; | ||
} else if (path.sep !== file.substr(0,1)) { | ||
//relative path from command line | ||
apiMocker.configFilePath = path.resolve(process.cwd(), file); | ||
} else { | ||
apiMocker.configFilePath = file; | ||
} | ||
apiMocker.configFilePath = file; | ||
_.defaults(apiMocker.options, require(file), apiMocker.defaults); | ||
_.defaults(apiMocker.options, require(apiMocker.configFilePath), apiMocker.defaults); | ||
return apiMocker; | ||
@@ -35,0 +40,0 @@ }; |
{ | ||
"name": "apimocker", | ||
"description": "Simple HTTP server using express, for server API mocking.", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Greg Stroup", |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9500
150