Skip to content

Latest commit

 

History

History
141 lines (136 loc) · 3.6 KB

output-format.md

File metadata and controls

141 lines (136 loc) · 3.6 KB

dependency-cruiser's json output format

The output format contains two sections:

  • modules - an array of all sources dependency-cruiser visited, each with the sources they directly depend upon
  • summary - a summary with meta information like how many sources got visited, how many violations it found, array of the actual violations and the rule set and other options used in the cruise.

A json schema describes the output format attributes in painstaking detail. The schema is accurate and actual - each build unit tests assure the output format adheres to the schema.

A sample output (for the popular commander.js module):

{
  "modules": [
    {
      "source": "commander/index.js",
      "dependencies": [
        {
          "resolved": "child_process",
          "coreModule": true,
          "followable": false,
          "couldNotResolve": false,
          "dependencyTypes": ["core"],
          "module": "child_process",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        },
        {
          "resolved": "events",
          "coreModule": true,
          "followable": false,
          "couldNotResolve": false,
          "dependencyTypes": ["core"],
          "module": "events",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        },
        {
          "resolved": "fs",
          "coreModule": true,
          "followable": false,
          "couldNotResolve": false,
          "dependencyTypes": ["core"],
          "module": "fs",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        },
        {
          "resolved": "graceful-readlink/index.js",
          "coreModule": false,
          "followable": true,
          "couldNotResolve": false,
          "dependencyTypes": ["npm"],
          "module": "graceful-readlink",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        },
        {
          "resolved": "path",
          "coreModule": true,
          "followable": false,
          "couldNotResolve": false,
          "dependencyTypes": ["core"],
          "module": "path",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        }
      ]
    },
    {
      "source": "child_process",
      "followable": false,
      "coreModule": true,
      "couldNotResolve": false,
      "dependencyTypes": ["npm"],
      "dependencies": []
    },
    {
      "source": "events",
      "followable": false,
      "coreModule": true,
      "couldNotResolve": false,
      "dependencyTypes": ["core"],
      "dependencies": []
    },
    {
      "source": "fs",
      "followable": false,
      "coreModule": true,
      "couldNotResolve": false,
      "dependencyTypes": ["core"],
      "dependencies": []
    },
    {
      "source": "path",
      "followable": false,
      "coreModule": true,
      "couldNotResolve": false,
      "dependencyTypes": ["core"],
      "dependencies": []
    },
    {
      "source": "graceful-readlink/index.js",
      "dependencies": [
        {
          "resolved": "fs",
          "coreModule": true,
          "followable": false,
          "couldNotResolve": false,
          "dependencyTypes": ["core"],
          "module": "fs",
          "moduleSystem": "cjs",
          "valid": true,
          "circular": false
        }
      ]
    }
  ],
  "summary": {
    "violations": [],
    "error": 0,
    "warn": 0,
    "info": 0,
    "totalCruised": 6,
    "optionsUsed": {
      "outputType": "json"
    }
  }
}