Socket
Socket
Sign inDemoInstall

circular-dependency-analyzer

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    circular-dependency-analyzer

Detect modules with circular dependencies in files


Version published
Weekly downloads
2
Maintainers
1
Install size
17.1 kB
Created
Weekly downloads
 

Readme

Source

circular-dependency-analyzer npm License

Detect modules with circular dependencies in files.

Installation

npm install circular-dependency-analyzer

// or

yarn install circular-dependency-analyzer

APIs

getFileRequiresStack

ParametersTypeDescription
dirstringdir is a directory based on process.cwd()
aliasobjectalias object's value is a directory or file based on process.cwd() too
ResultTypeDescription
stackobjectIt's an object with key(filepath). value(required filepath array), filepath is based on process.cwd(), besides, its /index and extname will be removed

getCircularReferences

ParametersTypeDescription
dirstringdir is a directory based on process.cwd()
aliasobjectalias object's value is a directory or file based on process.cwd() too
ResultTypeDescription
circularDependencies2 d arrayIt's a two-dimensional array, each item array represents a circular dependency

Examples

import { getFileRequiresStack, getCircularReferences } from 'circular-dependency-analyzer'

getFileRequiresStack('src')
getCircularReferences('src')

getFileRequiresStack('src', {
  fs: 'src/fs',
})
getCircularReferences('src', {
  fs: 'src/fs',
})

More examples you can find in tests dir.

Inspired or cp from

Keywords

FAQs

Last updated on 05 Sep 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc