All Projects → azu → express-router-dependency-graph

azu / express-router-dependency-graph

Licence: MIT license
A static code analysis tool that creates a dependency graph for express routing.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to express-router-dependency-graph

Module Linker
browse modules by clicking directly on "import" statements on GitHub ⛺
Stars: ✭ 229 (+780.77%)
Mutual labels:  dependency-graph
metahelm
Install dependency graphs of Kubernetes Helm Charts
Stars: ✭ 70 (+169.23%)
Mutual labels:  dependency-graph
sass-graph-viz
Draw a visual graph of Sass dependencies
Stars: ✭ 21 (-19.23%)
Mutual labels:  dependency-graph
Swift Code Metrics
Code metric analyzer for Swift projects.
Stars: ✭ 244 (+838.46%)
Mutual labels:  dependency-graph
keeptrack.space
🌎📡 TypeScript Astrodynamics Software for Non-Engineers. 3D Visualization of satellite data and the sensors that track them.
Stars: ✭ 61 (+134.62%)
Mutual labels:  visualize
javascript
Basic Primitives Diagrams for JavaScript - data visualization components library that implements organizational chart and multi-parent dependency diagrams, contains implementations of JavaScript Controls and PDF rendering plugins.
Stars: ✭ 46 (+76.92%)
Mutual labels:  dependency-graph
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+676.92%)
Mutual labels:  dependency-graph
react
Basic Primitives Diagrams for React. Data visualization components library that implements organizational chart and multi-parent dependency diagrams.
Stars: ✭ 15 (-42.31%)
Mutual labels:  dependency-graph
taiga-stats
Generate statistics from Taiga and produce burnup diagrams, CFDs, dependency graphs and more.
Stars: ✭ 40 (+53.85%)
Mutual labels:  dependency-graph
python dep generator
Genrates python dependency graph
Stars: ✭ 21 (-19.23%)
Mutual labels:  dependency-graph
Dg
[LLVM Static Slicer] Various program analyses, construction of dependence graphs and program slicing of LLVM bitcode.
Stars: ✭ 242 (+830.77%)
Mutual labels:  dependency-graph
cargo-supply-chain
Gather author, contributor and publisher data on crates in your dependency graph.
Stars: ✭ 287 (+1003.85%)
Mutual labels:  dependency-graph
planet-exporter
🚀 Determine server network dependencies along with required bandwidth
Stars: ✭ 17 (-34.62%)
Mutual labels:  dependency-graph
Git Deps
git commit dependency analysis tool
Stars: ✭ 232 (+792.31%)
Mutual labels:  dependency-graph
functionFinder
Visualize libraries easily
Stars: ✭ 15 (-42.31%)
Mutual labels:  visualize
Dependency Graph
A simple dependency graph for Node.js
Stars: ✭ 219 (+742.31%)
Mutual labels:  dependency-graph
fort depend.py
A python script to generate dependencies for Fortran projects
Stars: ✭ 35 (+34.62%)
Mutual labels:  dependency-graph
ansible-viz
Graph relationships between Ansible playbooks / roles / tasks / vars etc. via static analysis
Stars: ✭ 33 (+26.92%)
Mutual labels:  dependency-graph
govizz
No description or website provided.
Stars: ✭ 19 (-26.92%)
Mutual labels:  dependency-graph
nrwl-nx-action
A GitHub Action to wrap Nrwl Nx commands in your workflows.
Stars: ✭ 163 (+526.92%)
Mutual labels:  dependency-graph

express-router-dependency-graph

Create dependency graph for express routing.

Install

Install with npm:

npm install express-router-dependency-graph -g

Usage

Usage
  $ express-router-dependency-graph --rootDir=path/to/project

Options
  --rootDir               [Path:String] path to root dir of source code. The directory should have package.json  [required]
  --rootBaseUrl           [Path:String] if pass it, replace rootDir with rootDirBaseURL in output.
  --format                ["json" | "markdown"] output format. Default: json

Examples
  $ express-router-dependency-graph --rootDir=./

📝 --rootDir=<dir> the directory should have package.json.

This package.json should have express dependencies.

Example

Example output: markdown

  • File: file path
  • Method: get | post | put | delete | use(express's use)
  • Routing: routing path name
  • Middlewares: used middlewares
  • FilePath: source code position
File Method Routing Middlewares FilePath
src/game.ts
get /getGameById requireRead src/game.ts#L11-12
get /getGameList requireRead src/game.ts#L13-14
post /updateGameById requireWrite src/game.ts#L15-16
delete /deleteGameById requireWrite src/game.ts#L17-18
src/index.ts
use /user user src/index.ts#L8-8
use /game game src/index.ts#L9-9
src/user.ts
get /getUserById requireRead src/user.ts#L10-11
get /getUserList requireRead src/user.ts#L12-13
post /updateUserById requireWrite src/user.ts#L14-15
delete /deleteUserById requireWrite src/user.ts#L16-17

JSON output:

[
  {
    filePath: "<root>/src/game.ts",
    routers: [
      {
        method: "get",
        path: "/getGameById",
        middlewares: ["requireRead"],
        range: [288, 338],
        loc: { start: { line: 11, column: 0 }, end: { line: 12, column: 2 } }
      },
      {
        method: "get",
        path: "/getGameList",
        middlewares: ["requireRead"],
        range: [340, 390],
        loc: { start: { line: 13, column: 0 }, end: { line: 14, column: 2 } }
      },
      {
        method: "post",
        path: "/updateGameById",
        middlewares: ["requireWrite"],
        range: [392, 447],
        loc: { start: { line: 15, column: 0 }, end: { line: 16, column: 2 } }
      },
      {
        method: "delete",
        path: "/deleteGameById",
        middlewares: ["requireWrite"],
        range: [449, 506],
        loc: { start: { line: 17, column: 0 }, end: { line: 18, column: 2 } }
      }
    ]
  },
  {
    filePath: "<root>/src/index.ts",
    routers: [
      {
        method: "use",
        path: "/user",
        middlewares: ["user"],
        range: [140, 162],
        loc: { start: { line: 8, column: 0 }, end: { line: 8, column: 22 } }
      },
      {
        method: "use",
        path: "/game",
        middlewares: ["game"],
        range: [164, 186],
        loc: { start: { line: 9, column: 0 }, end: { line: 9, column: 22 } }
      }
    ]
  },
  {
    filePath: "<root>/src/user.ts",
    routers: [
      {
        method: "get",
        path: "/getUserById",
        middlewares: ["requireRead"],
        range: [287, 337],
        loc: { start: { line: 10, column: 0 }, end: { line: 11, column: 2 } }
      },
      {
        method: "get",
        path: "/getUserList",
        middlewares: ["requireRead"],
        range: [339, 389],
        loc: { start: { line: 12, column: 0 }, end: { line: 13, column: 2 } }
      },
      {
        method: "post",
        path: "/updateUserById",
        middlewares: ["requireWrite"],
        range: [391, 446],
        loc: { start: { line: 14, column: 0 }, end: { line: 15, column: 2 } }
      },
      {
        method: "delete",
        path: "/deleteUserById",
        middlewares: ["requireWrite"],
        range: [448, 505],
        loc: { start: { line: 16, column: 0 }, end: { line: 17, column: 2 } }
      }
    ]
  }
]

Changelog

See Releases page.

Related

Running tests

Install devDependencies and Run npm test:

npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].