The Just for Fun Foundation presents the code mapper.
This project runs through a Typescript project and maps all internal dependencies, generating a useful graph powered by Graphviz
You can find the source code for the project here
Please report any issues here
Type docs can be found here
$ npm i -g @justforfun/codemapper
You also need to make sure Graphviz is installed, it can be downloaded here
You may need to manually add the path to the bin folder in your environment variables: C:\Program Files (x86)\Graphviz2.38\bin
Note: This may be different for your system.
The code mapper is currently in its early stages of development, as such there are a few restrictions (see the next release and future work sections below for more).
The code mapper can be run globablly, after installing it you can run the following commands:
To run interactive mode use:
codemapper
See the section "Interactive mode" for more information about its use.
To run codemapper with all default values, detailed below, run the following:
codemapper -d
-d is short for --default, this will use the following values.
Once the app has started you will see a menu with several options:
As well as options that can be entered into any input
In CLI mode there are multiple parameters that can be included in the codemapper command to customise the processing to your liking.
Parameter | Shorthand | Description |
---|---|---|
--default | -d | Run codemapper using the default settings |
--input | -i | The input path of the project to map |
--output | -o | The output path of the graph data and the name you want to use |
--outName | -oN | The name of the graph file, this should not include the file extension |
--type | -t | Defaults to png. One of: png, jpeg, psd, svg, pdf, plain (for plain text), json, or dot |
--regex | -r | The regex used to exclude files, this will bypass the default regex. |
--includeNode | -iN | Include node_modules in the graph. This can take a very long time. |
--allFiles | -aF | Include all file typs in the graph. |
--verbose | -v | Output verbose information whilst processing |
--help | -h | Display the help menu |
Type | Output | Description |
---|---|---|
png | .png | PNG Image |
jpeg | .jpeg | JPEG Image |
psd | .psd | Photoshop Image |
svg | .svg | XML Vector Graphic Image |
PDF File | ||
plain | .txt | Plain text |
json | .json | JSON file |
dot | .dot | DOT Code |
Once the code has run successfully you will see a folder called "codemapper" inside the directory you selected.
Inside this directory you will find two files, the generated DOT code and the generated graph (Currently PNG only). You can see an example of the graph below.
See CHANGELOG for latest and future changes and bugs
This project is licensed under the MIT License
Generated using TypeDoc