dependit
v0.0.5
Published
Find the connection inside your project files
Downloads
1
Maintainers
Readme
dependit
Parse all the import
ed modules inside the file(Only ES Modules supported)
To install:
npm install dependit -S
Usage
import getDependency from 'dependit'
const filepath = '/path/to/your/file'
const result = getDependency(filepath)
API Documentation
getDependency(filepath)
filepath
absolute path to your file
Returned object
The return value is an object with all the dependencies information. The object's structure is listed below using TypeScript.
interface Result {
path: string,
dependencies: Array<Dependency>
}
interface Dependency {
source: string,
imported: Array<ImportedItem>
}
interface ImportedItem {
value: string,
local: string,
type: ImportType
}
enum ImportType {
default = 'ImportDefault',
import = 'Import',
namespace = 'ImportNamespace'
}
Supported file types
Currently only 4 types are supported:
.js
.jsx
.ts
.vue