tpae / node-repl

JavaScript Read-Eval-Print-Loop (REPL) for Atom
MIT License
11 stars 3 forks source link

allow for local modules when available #4

Closed tbremer closed 7 years ago

tbremer commented 7 years ago

This pull request allows for local node_modules by pushing the file's path to the repl context if that path has a node_modules directory.

tpae commented 7 years ago

This is interesting. Does it also take into account for local directory structure as well?

Are there any performance impacts by loading the node_modules?

tbremer commented 7 years ago

I hadn't checked for local module resolution, but you were right, that was not covered. I've found a way to allow for local modules as well as installed node_modules.

There should be no performance impact as we are just pushing file paths to the module resolution array, we aren't actually loading any additional modules.

tbremer commented 7 years ago

Updated the commit to allow for local module resolution.

tpae commented 7 years ago

Looks good. Merging