upquire

0.0.13 • Public • Published

Simple require.paths alternative

Avoids relative path backtracking.

Traverses up the directory structure from the location of the file in which the call to upquire is made, and looks for the module path to require along the way. Returns the require'd if its path is found on one of the parent directories.

Installation

  1. Add upquire as a dependency to your project’s package.json
  2. Run npm install

Usage Examples

Given directory structure

`--app
   |-- lib-1
   |   `-- mymodule-1
   |-- lib-2
   |   `-- mymodule-2

From app/lib-1/my-module-1

require('upquire')('/lib-2/my-module-2')

NOTE

Please, take a look at the code and give some feedback on smarter ways of doing this.

Readme

Keywords

none

Package Sidebar

Install

npm i upquire

Weekly Downloads

18

Version

0.0.13

License

none

Last publish

Collaborators

  • gnimmelf