dependencyTree only returning an empty object
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- tooling
Research direction
The report names dependencyTree, fs.readdir, and the ./src example; start by reproducing the [ {}, {}, {} ] result with the shown invocation. Check how dependencyTree resolves filename and directory, and consider the issue complete when the invocation returns dependency data for file1.js, file2.js, and file3.js.
Written by the indexing model from the issue text.
Description
I'm hoping someone can help me understand how to use this, as I seem to be getting an empty object back when using dependencyTree.
I have files along the lines of:
.
└── src/
├── file1.js (doesnt depend on anything)
├── file2.js (depends on file1.js)
└── file3.js (depends on file1.js and file2.js)
Above, where I state that a file depends on another, it imports the other file with require().
And I'm trying to get the dependency info like so:
const srcFiles = await fs.readdir('./src/');
const trees = srcFiles.map(filename => dependencyTree({ filename, directory: './src' }));
console.log(trees);
Which outputs:
[ {}, {}, {} ]
Obviously I'm expecting something other than an empty object for each file. If anyone can help me understand how to use this I'd appreciate it.
- Dominant language
- JavaScript
- Stars
- 776
- Forks
- 82
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dependents/node-dependency-tree
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
question
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Why is precinctOptions.includeCore always false?May be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dependents/node-dependency-tree#144 · 3 reactions ·
All issues in dependents/node-dependency-tree
Similar issues
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
cli: `studio --request <missing file>` answers with a raw ENOENT/EISDIR instead of a clear errorOpenbug good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
laaielichter/Ai-edit-studio#81 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
jasonacox/pypowerwall#472 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sebastienros/jint#4531 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days