You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since there may be numerous drivers in the wild, and the average user may not use most of the drivers, we need a way to only install and load the drivers the user is only interested in.
The text was updated successfully, but these errors were encountered:
Dynamic-loadable drivers can be installed using npm. For example,
$ npm install fpush-ssh-driver
Then to use the newly-installed driver, we can pass the CLI flag --dynamic-driver <driver>. For example,
$ fpush --dynamic-driver fpush-ssh-driver
The value passed (through dynamicDriver option in the API), is passed to require(), with the return value expected to be an object, with Driver property assigned to the Driver's class. For example,
// ... snip ...try{constdynamicDriver=require('fpush-ssh-driver');typeofdynamicDriver==="object";// truetypeofdynamicDriver.Driver==="function";// true; the class constructor}catch(ex){// ... snip ...}
Note: we are using an object, instead of returning the constructor from require(), to allow future additions to the drivers, without breaking the API.
Since there may be numerous drivers in the wild, and the average user may not use most of the drivers, we need a way to only install and load the drivers the user is only interested in.
The text was updated successfully, but these errors were encountered: