Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sonarqube-webapis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sonarqube-webapis

SonarQube / SonarCloud Web APIs Client Library for Node.js

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

sonarqube-webapis

SonarQube / SonarCloud Web APIs Client Library for Node.js

unittest Coverage Status Codacy Badge Codacy Badge

Disclaimer

I need this library to automate projects administration tasks submitted to sonarcloud, keep the lines of code matching with current billing plan.

I only use several resources, but since I want to make it public, I have to, at least cover full SonarCloud Web API.

This library may not be up to date with latest spec of SonarQube / SonarCloud Web API.

This library may not have the best design, but it works, only depends to axios, easy to test so have very high test coverage.

This library does not do any validation, just typechecking and pass it over to web api to validate.

Install

npm install sonarqube-webapis --save

Usage Example

// Example 1: get all components / projects in the organization.
import { AxiosError } from 'axios';
import Sonar from 'sonarqube-webapis';

(async () => {
  // Initiate Sonar.
  const sonar = new Sonar({
    auth: {
      username: '',
      password: '',
    },
    // You can use sonarcloud / sonarqube web api url.
    baseURL: 'https://sonarcloud.io/api',
  });
  try {
    // {@link https://sonarcloud.io/web_api/api/components/search}
    const result = await sonar.components.search('my-org2');
    // The result is in: result.data
    console.log('Components:', result.data.components);
  } catch (error) {
    // This is to show error messages from sonar.
    console.log('Errors: ',(error as AxiosError).response?.data.errors);
  }
})();

License

The project is available under the MIT license.

Keywords

FAQs

Package last updated on 30 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc