@safaricom-mxl/node-cli
v0.0.2
Published
MXL Node CLI for uploading sourcemaps from Node.js services
Downloads
177
Maintainers
Readme
MXL Node SDK CLI
This CLI helps with build-time sourcemap processing for Node.js services instrumented with the MXL Node SDK.
Quick Start
npm:
npm install --save-dev @safaricom-mxl/node-cliyarn:
yarn add -D @safaricom-mxl/node-cliUpload sourcemaps
To upload sourcemaps to MXL as part of your build process you will require the following:
- Your MXL Service ID
- Your MXL
Symbol UploadAPI token (found in your MXL dashboard in Settings->API) - The path to where the built JS files live
npx mxl-node-cli upload -s "YOUR_MXL_SERVICE_ID" -t "YOUR_MXL_UPLOAD_API_TOKEN" -p "ARTIFACT_PATH"[!WARNING] The CLI must be run BEFORE the files are packaged (e.g., before creating a Docker image or deployment archive). The CLI injects a comment and a short function to the end of bundle files to enable symbolication, so it needs to happen before packaging.
Setting service version
The same upload sub-command as above can be used to inject your app's version into your bundle if the value is only
known at build time. If the version is known prior to build time you can provide it when initializing the SDK.
Execute the same command as above while also providing your service version:
npx mxl-node-cli upload -s "YOUR_MXL_SERVICE_ID" -t "YOUR_MXL_UPLOAD_API_TOKEN" -p "ARTIFACT_PATH" --service-version "SERVICE_VERSION"