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

import-hierarchy

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

import-hierarchy

Analyze list of node ES6 imports to determine a hierarchy.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

Import Hierarchy

Import Hierarchy is a CLI tool that analyzes list of ES6 imports to determine hierarchy and output that a JSON file. The most common use is to generate a hierarchy tree for component based frameworks like React for documentation purposes. See examples

Installation

From NPM for use as a command line app:

npm install import-hierarchy -g

From NPM for local project use:

npm install import-hierarchy --save

Usage

It provides a CLI command that takes an initial starting file to analyze and write the results to a JSON file on the server.

import-hierarchy <startingFilePath> [options] -o <JSONOutputPath>

CLI Options

-h, --help                                  Display help for commands
-v, --version                               Output the version number
-o, --output <filePath>                     The output file path for the JSON to be written
-sd, --systemDirectory <pathToRemove>       String `find and replace` to remove the base system directory from the file paths

Example JSON Output

{
  "index.tsx": {
    "name": "index",
    "imports": [
      {
        "name": "App",
        "source": "App.tsx"
      },
      {
        "name": "reportWebVitals",
        "source": "reportWebVitals.ts"
      }
    ]
  },
  "App.tsx": {
    "name": "App",
    "imports": [
      {
        "name": "logo",
        "source": "logo.svg"
      }
    ]
  },
  "reportWebVitals.ts": {
    "name": "reportWebVitals",
    "imports": []
  }
}

Keywords

FAQs

Package last updated on 02 Aug 2021

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