https://github.com/sonarsource/sonar-scanner-npm
SonarQube Scanner for the JavaScript world
https://github.com/sonarsource/sonar-scanner-npm
Last synced: 4 months ago
JSON representation
SonarQube Scanner for the JavaScript world
- Host: GitHub
- URL: https://github.com/sonarsource/sonar-scanner-npm
- Owner: SonarSource
- License: lgpl-3.0
- Created: 2022-12-06T13:34:21.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2025-09-12T08:30:35.000Z (4 months ago)
- Last Synced: 2025-09-12T10:26:43.613Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.69 MB
- Stars: 51
- Watchers: 1
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# NPM module to run SonarQube Server and Cloud analyses
`@sonar/scan` makes it very easy to trigger SonarQube [Server](https://www.sonarqube.org)
and [Cloud](https://sonarcloud.io) analyses on a JavaScript code base, without needing
to install any specific tool or (Java) runtime.
This module is analyzed on SonarQube Cloud.
[](https://sonarcloud.io/project/overview?id=SonarSource_sonar-scanner-npm) [](https://sonarcloud.io/project/overview?id=SonarSource_sonar-scanner-npm) [](https://sonarcloud.io/project/overview?id=SonarSource_sonar-scanner-npm) [](https://sonarcloud.io/project/overview?id=SonarSource_sonar-scanner-npm) [](https://github.com/SonarSource/sonar-scanner-npm/releases) [](https://badge.fury.io/js/@sonar%2Fscan)
This is the documentation for v4. If you are using v3, refer to [the v3 documentation](https://github.com/SonarSource/sonar-scanner-npm/tree/3.5.0).
## Installation
_Prerequisite: Node v18+ (for v4 and above)_
_Prerequisite: Node v16+ (for [v3](https://github.com/SonarSource/sonar-scanner-npm/tree/3.5.0), otherwise use sonarqube-scanner [v2.9.1](https://github.com/SonarSource/sonar-scanner-npm/tree/2.9.1))_
This package is available on npm as: [`@sonar/scan`](https://www.npmjs.com/package/@sonar/scan)
To install the scanner globally and be able to run analyses on the command line:
```sh
npm install -g @sonar/scan
```
## Getting Started
If you want to run an analysis without having to configure anything in the first place, simply run the `sonar` command. The following
example assumes that you have installed SonarQube Server locally:
```
cd my-project
sonar
```
or you can use `npx` without installing:
```
cd my-project
npx @sonar/scan
```
## Documentation
For the extended information, please refer to its [documentation](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/npm/introduction/).
## License
`@sonar/scan` is licensed under the [LGPL v3 License](http://www.gnu.org/licenses/lgpl.txt).