Skip to content

Feature: Populate module info with installed node modules #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 31, 2015

Conversation

frankebersoll
Copy link
Contributor

This feature (Issue #6) adds a NodeModuleCollector.ts that tries to find all currently loaded npm modules:

  1. It synchronously runs npm ls --depth=0 --json to get all installed packages on root level. Those modules are cached, as they won't change during runtime.
  2. It checks require.cache to get all currently cached modules. Those are all JavaScript files that have been required since startup of the application.
  3. It crops all those paths to get the portion behind /node_modules/, which is the module name, and makes them unique.
  4. It returns all installed packages from 1. that match those module names.

@niemyjski
Copy link
Member

Awesome job

@niemyjski
Copy link
Member

Is this ready to be tested and merged?

@frankebersoll
Copy link
Contributor Author

Absolutley. Currently working on #8 for it to make it into the same release.

@ejsmith
Copy link
Member

ejsmith commented Oct 30, 2015

Awesome!

@frankebersoll
Copy link
Contributor Author

This now contains support for additional properties (#8), including some unit tests to check for compatibility with common browser properties.

@niemyjski
Copy link
Member

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants