The recipe in previous revisions of this gist is obsolete as dependency-cruiser supports typescript (and coffeescript, livescript) out of the box since december 2016, so it's currently as simple as:
npm i --global dependency-cruiser
# ... assuming your source is in src, you can dump the dependencies
# (including those in node_modules) to a file with:
depcruise -T json -f dependencies.json src
# or if you want to make a graph - send it through graphviz dot
depcruise -x node_modules -T dot src | dot -T svg > dependencygraph.svg
(Assuming TypeScript is installed --global as well)