Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @neo9/n9-node-sonar-generate with all npm packages installed. Try it out:

var n9NodeSonarGenerate = require("@neo9/n9-node-sonar-generate")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@neo9/n9-node-sonar-generate v1.0.2

Node Sonar Generate Module


Generate a file based on the project package.json.

npm version Travis Coverage license


npm install --save-dev @neo9/n9-node-sonar-generate


In your package.json add the end of your test script, add n9-sonar-generate command:

  "scripts": {
    "test": "... && n9-sonar-generate"


For this example, we asume that pkg is the representation of package.json.

n9-sonar-generate will create a file with these properties:

  • sonar.projectKey = || pkg.sonar.projectKey
  • sonar.projectName = pkg.description || pkg.sonar.projectName
  • sonar.projectVersion = pkg.version || pkg.sonar.projectVersion
  • sonar.sources = pkg.sonar.sources || ./src
  • sonar.sourceEncoding = pkg.sonar.sourceEncoding || UTF-8
  • sonar.tests = pkg.sonar.tests || ./test


Every key added to the sonar property in the package.json will be added to with the sonar. prefix.



  "sonar": {
    "host.url": "http://localhost:9000"

Will add to

TypeScript Project

To use with a TypeScript project, please add the following to your package.json:


  "sonar": {
    "coverage.exclusions": "src/*.d.ts",
    "ts.coverage.lcovReportPath": "./coverage/",
    "ts.tslint.path": "./node_modules/.bin/tslint",
    "ts.tslint.configPath": "./tslint.json"


Don't forget to add in your .gitignore

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free