{"library":"sonar-scanner","title":"SonarQube Scanner Node.js Wrapper","type":"library","description":"The `sonar-scanner` npm package serves as a convenient Node.js wrapper for the official, Java-based SonarQube Scanner command-line interface. It simplifies the integration of SonarQube code analysis into Node.js projects by providing an `npm install` and `npm run` entry point, eliminating the need for manual downloads and path configurations of the SonarQube Scanner CLI. The current stable version, 3.1.0, was last published in February 2021. While the wrapper itself has seen limited recent development, its primary function is to proxy commands to the underlying SonarQube Scanner, which continues to evolve independently. Its key differentiator is providing a straightforward Node.js ecosystem entry for SonarQube analysis, primarily aimed at CI/CD pipelines within JavaScript/TypeScript projects.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install sonar-scanner"],"cli":{"name":"sonar-scanner","version":null}},"imports":["/* Use via npm script: `npm run sonar-analysis` after configuring in package.json */","/* Use via shell: `node_modules/.bin/sonar-scanner` */","/* No specific TypeScript types are exported by this wrapper. */"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://sonarqube.org/","github":"https://github.com/bcaudan/node-sonar-scanner","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sonar-scanner","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"{\n  \"name\": \"my-node-project\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A simple Node.js project for SonarQube analysis.\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"sonar-analysis\": \"sonar-scanner -Dsonar.projectKey=my_nodejs_project -Dsonar.projectName='My Node.js Project' -Dsonar.sources=./src -Dsonar.typescript.tsconfigPath=./tsconfig.json -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=your_organization_key -Dsonar.token=${SONAR_TOKEN:-}\"\n  },\n  \"devDependencies\": {\n    \"sonar-scanner\": \"^3.1.0\"\n  }\n}\n\n// To run the analysis after `npm install`:\n// npm run sonar-analysis\n\n// The SONAR_TOKEN environment variable should be set in your CI/CD pipeline\n// or locally for authentication (e.g., SONAR_TOKEN=your_token npm run sonar-analysis).","lang":"json","description":"Demonstrates how to integrate `sonar-scanner` into a Node.js project's `package.json` scripts for SonarQube analysis, configuring basic project properties and token authentication.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}