Getting Started
Install
Sandworm Audit requires Node 14.19+.
When using npm, Sandworm Audit supports lockfile versions 2 and 3 (npm 7+).
Install sandworm-audit
globally via your favorite package manager:
You can also directly run without installing via:
Run Sandworm in the terminal
To use Sandworm Audit as a command-line tool, simply run sandworm-audit
or npx @sandworm/audit@latest
in the root directory of your app, or use the -p
option to point to the root dir.
The app root directory should contain a manifest file (package.json
) and a lockfile (package-lock.json
, yarn.lock
, or pnpm-lock.yaml
).
If you use workspaces, make sure to run Sandworm in the directory of the package you want to audit.
You can use a configuration file, or you can pass configuration options directly to the command-line tool. Here are the available options, that you can also list by running sandworm-audit --help
:
Generating a report can sometimes take a while, depending on how many direct and transient dependencies your app has in total. Sandworm fetches details about each individual dependency from the registry, so network conditions and registry availability are factors that can influence the total audit duration.
Dense, convoluted dependency graphs may require a lot of memory to render into the SVG trees that Sandworm produces. If the auditing process crashes with a heap out of memory
error while outputting the charts, your options are:
Allocate more memory to the node process by exporting
NODE_OPTIONS="--max-old-space-size=16384"
Reduce the depth of the tree represented by passing the
--max-depth
option to Sandworm - defaults to 7 layers of depthUse the
--skip-tree
option to skip building the treeTry another package manager
After completing a report, Sandworm:
Outputs a summary of the identified issues to the console, as well as a list of them sorted by severity;
Writes the following audit artefacts in the
sandworm
directory, or your custom output path:NAME@VERSION-dependencies.csv
NAME@VERSION-report.json
NAME@VERSION-tree.svg
NAME@VERSION-treemap.svg
Exits with an error, if a fail policy is set and the fail conditions are met.
Last updated