New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

circular-dependency-analyzer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

circular-dependency-analyzer

Detect modules with circular dependencies in files

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 05 Sep 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