> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/npm/introduction.md).

# Introduction

The SonarScanner for NPM makes it very easy to trigger a SonarQube Server 2026.5 analysis on your JavaScript code base, without needing additional tools or resources.

The SonarScanner for NPM makes it very easy to trigger a SonarQube analysis on a JavaScript code base, without needing any additional tool or resource.

{% hint style="info" %}
This documentation refers to the SonarScanner for NPM from version 4.0.
{% endhint %}

## Analysis process with the SonarScanner for NPM <a href="#analysis-process" id="analysis-process"></a>

To start the SonarScanner for NPM, you can:

* Either add the analysis to your build files.\
  In that case, the JS code API of the scanner is used.
* Or use the scanner start command line (with or without npx).\
  In that case, the command line API of the scanner is used.

The analysis process of your project with the SonarScanner for NPM is as follows:

1. Your build or CI pipeline starts the SonarScanner for NPM. Analysis parameters can be passed to the scanner at this step.
2. The scanner collects the other analysis parameters set on the CI/CD host.
3. The scanner downloads the scanner binary files necessary to execute the analysis from SonarQube and adds them to its cache.
4. The scanner gets the project’s analysis parameters and other settings from SonarQube.
5. The scanner runs the analysis.
6. The scanner informs the build or CI pipeline that its analysis is complete.

<figure><img src="broken://spaces/KXW79zfYFiA8incTvwZK/files/59ADuZQsawduIFGpF0rU" alt="How the SonarScanner for NPM integrates with your CI/CD pipeline."><figcaption></figcaption></figure>

## Related pages <a href="#related-pages" id="related-pages"></a>

[Installing the scanner](/sonarqube-server/analyzing-source-code/scanners/npm/installing.md)

[Using the scanner](/sonarqube-server/analyzing-source-code/scanners/npm/using.md)

[Configuring the scanner](/sonarqube-server/analyzing-source-code/scanners/npm/configuring.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/scanners/npm/introduction.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
