
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This library explores and visualizes project dependencies, offering both CLI-based text output and an interactive visualizer for intuitive understanding of file relationships.
"DePon!!" is a tool for visualizing the dependencies of JS/TS-based projects. It provides both a CLI and functions.
In the future, it will also offer the feature to visualize dependencies as a graph.
"DePon!!" can be installed via npm.
# install
npm install depon
or CLI tools are also provided.
# cli
npx depon --help
The CLI provides the following commands:
Examples targeting ./examples are shown below.
Displays the dependencies of the target file in a tree format.
# input
npx depon tree --target-dir ./examples ./examples/src/index.ts
# output
🌲 Dependency Tree 🌲
✔ Analysis Complete !!
👶 Children Tree 👶
└── examples/src/index.ts
├── examples/src/elements/A (depth:1)/index.tsx
│ ├── examples/src/elements/A (depth:1)/C (depth:2)/index.ts
│ │ ├── examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/index.tsx
│ │ │ └── examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/H (depth: 4)/index.tsx
│ │ │ └── examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/H (depth: 4)/I (depth: 5)/index.tsx
│ │ └── examples/src/elements/A (depth:1)/C (depth:2)/G (depth:3)/index.tsx
│ └── examples/src/elements/A (depth:1)/D (depth:2)/index.tsx
└── examples/src/elements/B (depth:1)/index.tsx
└── examples/src/elements/B (depth:1)/E (depth:2)/index.tsx
🎅 Parents Tree 🎅
└── examples/src/index.ts
| Option | Type | Description | Default Value |
|---|---|---|---|
| target-dir* | string | Specify the target directory | None |
| --no-children | boolean | Do not display child dependencies | false |
| --no-parents | boolean | Do not display parent dependencies | false |
| --absolute | string | Display as absolute paths | false |
| --depth | string | Specify the depth to search (root is 0) | None |
| --ignore-patterns | string | Specify patterns of files/directories to exclude from analysis | None |
| --alias-resolver | record | If { "@" : ".", "~" : ".." }, then it would be ~/@/path will be replaced as .././path | None |
Displays the dependencies of the target file in a list format.
# input
npx depon list --target-dir ./examples ./examples/src/index.ts
# output
📋 Dependency List 📋
✔ Analysis Complete !!
👶 Children List 👶
examples/src/elements/A (depth:1)/index.tsx
examples/src/elements/A (depth:1)/C (depth:2)/index.ts
examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/index.tsx
examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/H (depth: 4)/index.tsx
examples/src/elements/A (depth:1)/C (depth:2)/F (depth:3)/H (depth: 4)/I (depth: 5)/index.tsx
examples/src/elements/A (depth:1)/C (depth:2)/G (depth:3)/index.tsx
examples/src/elements/A (depth:1)/D (depth:2)/index.tsx
examples/src/elements/B (depth:1)/index.tsx
examples/src/elements/B (depth:1)/E (depth:2)/index.tsx
🎅 Parents List 🎅
| Option | Type | Description | Default Value |
|---|---|---|---|
| target-dir* | string | Specify the target directory | None |
| --no-children | boolean | Do not display child dependencies | false |
| --no-parents | boolean | Do not display parent dependencies | false |
| --absolute | string | Display as absolute paths | false |
| --depth | string | Specify the depth to search (root is 0) | None |
| --ignore-patterns | string | Specify patterns of files/directories to exclude from analysis | None |
| --alias-resolver | record | If { "@" : ".", "~" : ".." }, then it would be ~/@/path will be replaced as .././path | None |
The API provides the following functions under generator and analyzer.
generator
genFileRelationanalyzer
getChildrenListgetParentsListgetChildrenTreegetParentsTreeBelow is a concrete example.
import {
genFileRelation,
getChildrenList,
getParentsList,
getChildrenTree,
getParentsTree,
} from "depon";
const targetDir = "./examples/src";
const fileRelation = genFileRelation({ targetDir });
// Get a list of files that depend on main.tsx
const childrenList = getChildrenList(fileRelation, "main.tsx");
const parentsList = getParentsList(fileRelation, "main.tsx");
// Get a tree of files that depend on main.tsx
const childrenTree = getChildrenTree(fileRelation, "main.tsx");
const parentsTree = getParentsTree(fileRelation, "main.tsx");
genFileRelationArguments for genFileRelation
| Argument | Type | Description |
|---|---|---|
targetDir | string | Specify the target directory |
ignorePatterns | string[] (optional) | Specify patterns of files/directories to exclude |
aliasResolver | Record<string, string> (optional) | If { "@" : ".", "~" : ".." }, then it would be ~/@/path will be replaced as .././path. |
Return value of genFileRelation
export type ImportType = "import" | "require" | "dynamicImport" | "export";
export type RelationNode = {
parent: string;
child: string;
};
export type FileRelationNode = RelationNode & {
context: {
importType: ImportType;
targetType: "file" | "external";
};
};
| Type | Description |
|---|---|
FileRelationNode[] | Contains paths of parent and child dependencies |
getChildrenList, getParentsListArguments for getChildrenList, getParentsList
| Argument | Type | Description |
|---|---|---|
relationList | FileRelationNode[] | Specify the return value of genFileRelation |
targetKey | string | Specify the target file |
depth | number? | Specify the depth to search (root is 0) |
Return value of getChildrenList, getParentsList
| Type | Description |
|---|---|
{ key:string }[] | Array containing paths of related files under key |
getChildrenTree, getParentsTreeArguments for getChildrenTree, getParentsTree
| Argument | Type | Description |
|---|---|---|
relationList | FileRelationNode[] | Specify the return value of genFileRelation |
targetKey | string | Specify the target file |
depth | number? | Specify the depth to search (root is 0) |
stopCondition | (key, depth) => boolean ? | Once the function is true, no further searching is done. |
Return value of getChildrenTree, getParentsTree
// Return value of getChildrenTree
type ChildrenTree<T extends RelationNode> = {
key: string;
children: ChildrenTree<T>[];
};
// Return value of getParentsTree
type ParentsTree<T extends RelationNode> = {
key: string;
parents: ParentsTree<T>[];
};
| Type | Description |
|---|---|
ChildrenTree | ParentsTree | Have a recursive structure of related file paths in tree form |
FAQs
This library explores and visualizes project dependencies, offering both CLI-based text output and an interactive visualizer for intuitive understanding of file relationships.
The npm package depon receives a total of 196 weekly downloads. As such, depon popularity was classified as not popular.
We found that depon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.