Socket
Socket
Sign inDemoInstall

includemvc

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    includemvc

Helpers to require files without the relative paths.


Version published
Weekly downloads
1
Maintainers
1
Install size
59.2 kB
Created
Weekly downloads
 

Readme

Source

Install

npm install includemvc

How to use

Having a directory structure like this:

- root
---- app.js
---- lib
------ mylib.js
---- modules
------ mymodule
-------- controllers
---------- index.js
-------- models
---------- index.js
-------- index.js

You can use any of the following methods to require your files

Methods available

include(module, type, file)

Example:

	var include = require("include");
	var mycontroller = include("mymodule", "controllers");

include.controller(module)

Example:

	var include = require("include");
	var mycontroller = include.controller("mymodule");

include.model(module)

Example

	var include = require("include");
	var mymodel = include.model("mymodule");

include.root(file)

Example

	var include = require("include");
	var app = include.root("app");

include.app()

Example

	var include = require("include");
	var app = include.app();

include.lib(file);

Example

	var include = require("include");
	var mylib = include.lib("mylib");

include.path(directory, file);

Example

	var include = require("include");
	var mylib = include.path("lib", "mylib");

License

Released under the MIT License, see LICENSE for the full license

Keywords

FAQs

Last updated on 09 Apr 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc