sfdx-prebuilt
An NPM installer for SFDX, API interface for Force.com and all Salesforce DX features.
Building and Installing
npm install sfdx-prebuilt
Or grab the source and
node ./install.js
What this installer is really doing is just grabbing a particular "blessed" (by this module) version of SFDX. As new versions of SFDX are released and vetted, this module will be updated accordingly.
Running via node
The package exports a path
string that contains the path to the
SFDX binary/executable.
Below is an example of using this package via node.
var path = var childProcess = var sfdx = var binPath = sfdxpath var childArgs = 'force' '--help' childProcess
Or exec()
method is also provided for convenience:
var sfdx = var program = sfdxprogramstdoutprogramstderrprogram
Note: childProcess.spawn() is called inside exec()
.
Versioning
The major and minor number tracks the version of SFDX that will be installed. The patch number is incremented when there is either an installer update or a patch build of the sfdx binary.