Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dependit

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependit

Find the connection inside your project files

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

dependit

Parse all the imported 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

FAQs

Package last updated on 19 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc