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

emocks

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emocks - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

.editorconfig

31

package.json
{
"name": "emocks",
"version": "1.1.0",
"version": "2.0.0",
"description": "Mock server based on expressjs",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"test": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha"
"test": "jest",
"build": "tsc",
"prepublish": "npm run build"
},

@@ -25,12 +27,21 @@ "repository": {

"devDependencies": {
"express": "^4.13.3",
"istanbul": "^0.3.21",
"mocha": "^2.3.3",
"supertest": "^1.1.0"
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/express": "^4.17.13",
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.8",
"@types/rimraf": "^3.0.2",
"@types/supertest": "^2.0.11",
"babel-jest": "^27.4.6",
"express": "^4.17.2",
"jest": "^27.4.7",
"supertest": "^6.1.6",
"ts-node": "^10.4.0",
"typescript": "^4.5.4"
},
"dependencies": {
"fs-extra": "^0.24.0",
"lodash": "^3.10.1",
"rimraf": "^2.4.3"
"lodash": "^4.17.21"
}
}

@@ -5,3 +5,3 @@ # emocks

## How does it work?
* Organize all your mocks using folder structure, that will correspond your api url.
* Organize all of your mocks using folder structure, representing your api url
* You can use HTTP VERBS as file names to create different mocks

@@ -13,3 +13,2 @@ * You can use static .json files for responses or .js modules, that can create dynamic answers

* custom headers
* live update

@@ -19,3 +18,3 @@ ## Installation

## Example
Assume we have the following folder structure:
Assuming we have the following folder structure:
```

@@ -31,8 +30,8 @@ |-- mocks

```javascript
var path = require('path');
var express = require('express');
var emocks = require('emocks');
var bodyParser = require('body-parser');
const path = require('path');
const express = require('express');
const emocks = require('emocks');
const bodyParser = require('body-parser');
var app = express();
const app = express();
app.use(bodyParser.json());

@@ -98,9 +97,9 @@ app.use('/', emocks(path.join(__dirname, './mocks')));

headers: { "X-Custom-Global-Header": "Hello!" },
//rebind mocks on file changes
watch: true
});
```
### Now supports typescript!
## Additional info
Please offer suggestions via issues.
emocks is an abbreviation for express mocks. Any similarity to emacs is unintended.

Sorry, the diff of this file is not supported yet

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