Add ability to specify options dependencies programatically

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Problem Description

      The Node.js driver uses

      try { require('...') } catch {}
      

      to load optional dependencies. That does not always play well with JS bundlers or other source code transformations, where `require()` may fall back to searching the filesystem instead of the bundle.

      It would be nice if the driver provided a way to pass in these dependencies programatically, leaving the actual `require()` call to its consumer.

      This could (for example) come in the form of options passed to the MongoClient constructor/connect method, or one or more global functions on the driver exports object itself for storing the modules.

            Assignee:
            Unassigned
            Reporter:
            Anna Henningsen
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: