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.0.0 to 1.1.0

18

index.js

@@ -27,2 +27,10 @@ /* jshint esnext:true, node:true */

function parseFName(fname) {
var arr = fname.split('.');
return {
verb: arr[0].toLowerCase(),
status: arr[1] ? Number(arr[1]) : null
};
}
function bindProcessors(paths){

@@ -37,2 +45,3 @@ var currentPath = path.join(root, paths.join('/'));

var parsed = path.parse(dir);
switch(parsed.ext){

@@ -51,6 +60,11 @@ case '.json':

var parsedName = parseFName(parsed.name);
var respCb = function emocksHandle(req, res){
if(headers){
if (headers) {
res.set(headers);
}
if (parsedName.status) {
res.status(parsedName.status);
}
res.sendFile(currentPathFile);

@@ -63,3 +77,3 @@ };

}
router[parsed.name.toLowerCase()](routes, respCb);
router[parsedName.verb](routes, respCb);
break;

@@ -66,0 +80,0 @@ }

2

package.json
{
"name": "emocks",
"version": "1.0.0",
"version": "1.1.0",
"description": "Mock server based on expressjs",

@@ -5,0 +5,0 @@ "main": "index.js",

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