root-require
require() using a relative path from the root directory of the present module
Last updated 11 years ago by balderdashy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install root-require 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.1                                ...           latest (11 years ago)

8 Versions

  • 0.3.1                                ...           11 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.4                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 4
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE