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

root-require

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

root-require

require() using a relative path from the root directory of the present module

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1K
decreased by-77.54%
Maintainers
1
Weekly downloads
 
Created
Source

root-require

Usage

Just once:

var Sails = require('root-require')('lib/app');

More than once:

var rootRequire = require('root-require');

var Sails = rootRequire('lib/app');
var Router = rootRequire('lib/router');
var MiddlewareLibrary = rootRequire('lib/middleware');

Purpose

a more convenient require method for certain situations.

How it do

This lets you require() using a relative path from the root directory of the present module.

Credit where credit is due

This is mainly a thin wrapper around packpath (https://github.com/jprichardson/node-packpath)-- this module just exists so we can do it in one line.

License

MIT, c. 2014 Mike McNeil

Keywords

FAQs

Package last updated on 03 Jan 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc