Socket
Socket
Sign inDemoInstall

express-mock-api-middleware

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-mock-api-middleware - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

8

.eslintrc.json

@@ -8,3 +8,9 @@ {

},
"rules": {}
"rules": {
"func-names": "off",
"no-else-return": "off",
"no-param-reassign": "off",
"no-restricted-syntax": "off",
"no-use-before-define": "off"
}
}

6

lib/createMockMiddleware.js

@@ -35,3 +35,3 @@ "use strict";

function getMockMiddleware(mockDir) {
function getMockMiddleware(mockDir, options) {
var absMockPath = mockDir;

@@ -67,5 +67,5 @@ var _console = console,

var mockFiles = _glob.default.sync('**/*.js', {
var mockFiles = _glob.default.sync('**/*.js', _objectSpread({
cwd: absMockPath
}).map(function (p) {
}, options)).map(function (p) {
return (0, _path.join)(absMockPath, p);

@@ -72,0 +72,0 @@ });

@@ -7,4 +7,4 @@ "use strict";

module.exports = function (mockDir) {
return (0, _createMockMiddleware.default)(mockDir);
module.exports = function (mockDir, options) {
return (0, _createMockMiddleware.default)(mockDir, options);
};
{
"name": "express-mock-api-middleware",
"version": "1.0.0",
"version": "1.0.1",
"description": "Express middleware for mocking restful APIs",

@@ -37,6 +37,6 @@ "main": "lib/index.js",

"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.15.0",
"eslint": "^5.15.3",
"eslint-config-airbnb-base": "^13.1.0",

@@ -43,0 +43,0 @@ "eslint-config-prettier": "^4.1.0",

@@ -19,3 +19,4 @@ # express-mock-api-middleware

const mockApiMiddleware = require('express-mock-api-middleware')(
path.resolve(__dirname, 'mock')
path.resolve(__dirname, 'mock'),
{ ignore: ['asm.js'] }
);

@@ -25,2 +26,3 @@ app.use(mockApiMiddleware);

`path.resolve(__dirname, 'mock')` is the folder where mock API files are.
`{ ignore: ['asm.js'] }` is the options for more flexible glob. (See [options](https://github.com/isaacs/node-glob#options))

@@ -27,0 +29,0 @@ ## Mock files

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