smart-node-import

1.0.0 • Public • Published

smart-node-import

Require modules from defined project's root path.

Installation

npm install smart-node-import

Usage

Just once, in your bootstrap file. First parameter is a root path, and the second one is a cache path, which is optional.

require('smart-node-import')(__dirname + '/app', __dirname + '/temp');

Then to load modules from project's root path use @/ at the beginning:

const module = require('@/models/User');

Package Sidebar

Install

npm i smart-node-import

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

2.64 kB

Total Files

3

Last publish

Collaborators

  • adamcikado