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

my-express-module-loader

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

my-express-module-loader - npm Package Compare versions

Comparing version 0.1.3 to 1.0.0

5

core-lib-loader.js

@@ -14,3 +14,4 @@ var requireindex = require("requireindex"),

options = options || {};
options.dirname = options.dirname || __dirname;
options.dirname = options.dirname || path.join(process.cwd(), "lib");
options.loadExpressRouters = options.loadExpressRouters || true;

@@ -20,2 +21,4 @@ libs = requireindex(options.dirname);

doLoad(app, libs, options);
return libs;
}

@@ -22,0 +25,0 @@

2

package.json
{
"name": "my-express-module-loader",
"version": "0.1.3",
"version": "1.0.0",
"description": "A dynamic module loader. Focused mainly on being able to scan a directory for modules and mount routes on an express app if wanted",

@@ -5,0 +5,0 @@ "main": "core-lib-loader.js",

@@ -7,3 +7,27 @@ # my-express-module-loader

## Installation
npm install my-express-module-loader
## Usage
var app = require("express")();
var loader = require("my-express-module-loader");
loader(app);
## API
var loader = require("my-express-module-loader");
loader(app, options);
### loader(app, options)
* `app` express.App - An app on which to load express.Routers found in the modules. under the `.router` property
* `options` (Optional) Object.
* `dirname` (String) - The path on where to search for modules. This option is passed directly to [requireindex](https://www.npmjs.com/package/requireindex).
* `loadExpressRouter` (Boolean) - Set to `false` if you don't want this module to `app.use()` automatically
the exported `.router` property on every found module. Default `true`.
## LICENSE

@@ -13,3 +37,3 @@

Copyright (c) 2015 Oscar López < oskosk@gmail.com >
Copyright (c) 2015 Oscar López < oskosk@gmail.com >

@@ -16,0 +40,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

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