ts-morph
ts-morph copied to clipboard
Is it possible to resolve node_modules?
Hi,
I have a project where I need to determine whether the module fs is imported into a codebase. This must include the node_modules too.
So far I've been using addSourceFileAtPath with the codebase's entry and the dependencies resolved entries.
But as far as I can tell resolveSourceFileDependencies does not resolve the node_modules' imports.
Do you know how I can resolve the full codebase?
I think project.getAmbientModule("fs") or project.getAmbientModule("node:fs") https://github.com/dsherret/ts-morph/blob/a1c61c7e04928de5d8fc12f32a76e3ed5b7ffea1/packages/ts-morph/lib/ts-morph.d.ts#L644