mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
19 lines
465 B
TypeScript
19 lines
465 B
TypeScript
import dependencyTree = require('dependency-tree');
|
|
|
|
const tree = dependencyTree({
|
|
filename: 'path/to/a/file',
|
|
directory: 'path/to/all/files',
|
|
requireConfig: 'path/to/requirejs/config',
|
|
webpackConfig: 'path/to/webpack/config',
|
|
nodeModulesConfig: {
|
|
entry: 'module'
|
|
},
|
|
filter: path => path.indexOf('node_modules') === -1,
|
|
nonExistent: []
|
|
});
|
|
|
|
const list = dependencyTree.toList({
|
|
filename: 'path/to/a/file',
|
|
directory: 'path/to/all/files'
|
|
});
|