# Introduction

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-reference" 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](https://docs.sonarsource.com/sonarqube-server/2026.1/analyzing-source-code/scanners/npm/installing "mention")

[using](https://docs.sonarsource.com/sonarqube-server/2026.1/analyzing-source-code/scanners/npm/using "mention")

[configuring](https://docs.sonarsource.com/sonarqube-server/2026.1/analyzing-source-code/scanners/npm/configuring "mention")


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
