🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

rootrequire

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rootrequire

npm install --save rootrequire # then `var root = require('rootrequire'), myLib = require(root + 'path/to/lib.js');`

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1.5K
-17.41%
Maintainers
1
Weekly downloads
 
Created
Source

rootrequire

Require files relative to your project root. Why?

  • You can move files around more easily than you can with relative paths like ../../lib/my-lib.js
  • Every file documents your app's directory structure for you. You'll know exactly where to look for things.
  • Dazzle your coworkers.

Learn JavaScript with Eric Elliott

This was written for the "Learn JavaScript with Eric Elliott courses. Don't just learn JavaScript. Learn how to change the world.

Install

npm install --save rootrequire

Use

var
  root = require('rootrequire'),
  myLib = require(root + 'path/to/lib.js');

Keywords

require

FAQs

Package last updated on 09 Feb 2015

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