Skip to content

Scanning JavaScript/TypeScript NodeJS Projects

Fetch the latest agent image from an instance of Lineai, e.g.

Terminal window
docker pull lineai.com/lineai_javascript

Run the image, mounting the root of the project you wish to scan in a volume, e.g.

Terminal window
docker run \
--rm \
--interactive \
--tty \
--env LINEAI_HOST="https://lineai.com" \
--volume '/absolute/path/to/the/project:/scan' \
'lineai.com/lineai_javascript' \
analyze \
--path /scan \
--application my-project-name

By default, a new agent will be created in Lineai each time you run a scan. To avoid this, you can provide the container with credentials using the AGENT_UUID and AGENT_PASSWORD environment variables. For example, the command above could be re-written to include credentials from the local shell environment:

Terminal window
# Assuming that `AGENT_UUID` and `AGENT_PASSWORD` have
# been exported and are available in the shell environment
docker run \
--rm \
--interactive \
--tty \
--env LINEAI_HOST="https://lineai.com" \
--env AGENT_UUID="${AGENT_UUID}" \
--env AGENT_PASSWORD="${AGENT_PASSWORD}" \
--volume '/absolute/path/to/the/project:/scan' \
'lineai.com/lineai_javascript' \
analyze \
--path /scan \
--application my-project-name

For a list of available commands and options, you can run

Terminal window
docker run \
--rm \
--interactive \
--tty \
'lineai.com/lineai_javascript' analyze --help