exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Feature: Populate module info with installed node modules #33

Closed frankebersoll closed 9 years ago

frankebersoll commented 9 years ago

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 commented 9 years ago

Awesome job

niemyjski commented 9 years ago

Is this ready to be tested and merged?

frankebersoll commented 9 years ago

Absolutley. Currently working on https://github.com/exceptionless/Exceptionless.JavaScript/issues/8 for it to make it into the same release.

ejsmith commented 9 years ago

Awesome!

frankebersoll commented 9 years ago

This now contains support for additional properties (https://github.com/exceptionless/Exceptionless.JavaScript/issues/8), including some unit tests to check for compatibility with common browser properties.

niemyjski commented 9 years ago

Awesome!