Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

register-module

vinsonchuong7.7kMIT0.0.2

Register a module with Node.js for more concise imports

require, module, NODE_PATH

readme

register-module

Register a module with Node.js for more concise imports.

Installing

register-module is available as an npm package.

Usage

require('register-module')({
  name: 'project',
  path: '/home/vinsonchuong/project',
  main: 'entry.js'
});

// Resolves to '/home/vinsonchuong/project/entry.js'
require('project');

// Resolves to '/home/vinsonchuong/project/lib.js'
require('project/lib');