New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-route-builder

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-route-builder - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

20

index.js

@@ -56,3 +56,3 @@ 'use strict';

*/
addRoute (path, filename, _middleware = []) {
addRoute (path, input, _middleware = []) {

@@ -63,8 +63,14 @@ let middleware = _middleware || [];

// Attempt to load in the module.
try {
fullFilename = pathify(this.baseDir, filename);
module = require(fullFilename);
} catch (err) {
throw new Error(`Unable to load module "${fullFilename}" (${err.code || err.name}).`);
// Attempt to load in the module if a filename is given.
if (typeof input === 'string') {
try {
fullFilename = pathify(this.baseDir, input);
module = require(fullFilename);
} catch (err) {
throw new Error(`Unable to load module "${fullFilename}" (${err.code || err.name}).`);
}
// Otherwise assume the input is an object.
} else {
module = input;
}

@@ -71,0 +77,0 @@

@@ -10,3 +10,3 @@ {

"name": "express-route-builder",
"version": "0.0.5",
"version": "0.0.6",
"description": "Quickly compile Express.js routes with minimal code.",

@@ -13,0 +13,0 @@ "keywords": [

@@ -41,2 +41,4 @@ # Express-Route-Builder

**Note:** The function names must be lowercase.
```javascript

@@ -43,0 +45,0 @@ module.exports.get = function (req, res, next) { ... };

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