> 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/10.7/analyzing-source-code/scanners/npm/introduction.md).

# Introduction

The SonarScanner for NPM makes it very easy to trigger SonarQube analyses 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 the SonarQube Server and adds them to its cache.
4. The scanner gets the project’s analysis parameters and other settings from the SonarQube Server.
5. The scanner runs the analysis.
6. The scanner informs the build or CI pipeline that its analysis is complete.

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

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

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

[Configuring the scanner](/sonarqube-server/10.7/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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
