I'm new with NodeJs, my project is growing and i dont want make relative imports, i want imports like these installed from npm.
I have the following directory structure
Project node_modules/ src/ model/ person.js test/ model/ person.js app.js config.js
i'm using mongoose and i can require mongoose from any place with require('mongoose')
but by example if a want require my person model from app.js
i write require('./model/person')
and from my test/model/person.js
i need write require('../../src/model/person')
.
Exist some way "native" (without install more dependencies) to make this some like require('model/person')
from any place of my app?