question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configure additional module directories to search

See original GitHub issue
.
└── src
    ├── app
    │   └── main.js
    └── lib
        └── foo.js

In a project structured like this some people configure lib as a module directory. This lets main.js use require('foo') instead of require('../lib/foo')

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:6
  • Comments:11

github_iconTop GitHub Comments

7reactions
mctepcommented, Apr 21, 2016

Hello!

There are disscussion about per-project settings https://github.com/atom/atom/issues/5168 and plugin https://github.com/danielbrodin/atom-project-manager

I think in the future it will be common decision in atom core.

Now I just add moduleDirectory config in js-hyperclick/lib/suggestions.js file for js-hyperclick plugin after each update. But it affects all projects:

function resolveModule(textEditor, module) {
    const basedir = path.dirname(textEditor.getPath())
    const options = {
        basedir,
        extensions: atom.config.get('js-hyperclick.extensions'),
        // it is my custom options
        moduleDirectory: [
          'node_modules',
          'src',
          'src/lib'
        ]
    }
   // ...
}
2reactions
UziTechcommented, Jun 28, 2016

Could we also include NODE_PATH environmental variable for module directorys?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Module Search Path - Real Python
In this video, you're going to explore the module search path. ... An installation-dependent list of directories configured at the time ...
Read more >
Check and add the module search path with sys.path in Python
In Python, the list of directories searched when importing modules and packages with import , the module search path, is stored in sys.path...
Read more >
Expand Python Search Path to Other Source - Stack Overflow
In your program, use sys.path.append('/path/to/search') to add the names of directories you want Python to search for imported modules.
Read more >
The initialization of the sys.path module search path — Python ...
site-packages directories are added to the module search path. A common way to customize the search path is to create ; sitecustomize or...
Read more >
Can Drupal be configured to find modules in other locations?
I'm trying to leave the drupal folder inside www as usual, but move only the sites/all/modules to another location, but I still can't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found