Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Development

Import Path Extractor

· Last updated:2026-01-11

Extract all import/require paths from JavaScript/TypeScript code

Details

What this tool helps you do

Import Path Extractor

This tool extracts all import and require statements from JavaScript/TypeScript code:

Supported Import Types:

  • ES6 Imports: import ... from 'path'
  • TypeScript Type-only Imports: import type ... from 'path'
  • Dynamic Imports: import('path')
  • CommonJS Requires: require('path')
  • Export From: export ... from 'path'

Path Categories:

  • Package Imports: node_modules packages (e.g., 'react', 'lodash')
  • Relative Imports: Local files (e.g., './utils', '../components')
  • Absolute Imports: Absolute paths (e.g., '/src/config')

Features:

  • Line number tracking for each import
  • Deduplication of import paths
  • Grouping by import type
  • Filtering by package/relative paths
  • Support for both JavaScript and TypeScript

Example Usage:

import React from 'react'
import { useState } from 'react'
import type { User } from './types'
import * as lodash from 'lodash'
const utils = require('./utils')
import('./lazyModule').then(module => {})
export { Component } from './Component'

Use Cases:

  • Analyze code dependencies
  • Find all imported modules
  • Identify external dependencies
  • Refactor import statements
  • Audit code for unused imports

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Development
Input types
textarea, checkbox
Output type
json
Sample coverage
4
API ready
Yes

Overview

The Import Path Extractor is a tool that extracts all import and require statements from JavaScript or TypeScript code. It supports ES6 imports, TypeScript type-only imports, dynamic imports, CommonJS requires, and export-from statements, providing a clear view of code dependencies.

When to use

  • When analyzing dependencies in a JavaScript or TypeScript project to understand module relationships.
  • To identify all external packages and relative file imports for auditing or documentation purposes.
  • During code refactoring to locate and update import paths efficiently.

How it works

  1. 1Paste your JavaScript or TypeScript code into the input field.
  2. 2Configure options to include or exclude node modules and relative paths, and choose to group results by import type.
  3. 3The tool parses the code, extracts all import and require statements, and tracks line numbers.
  4. 4Results are displayed in JSON format, with deduplicated paths and optional grouping for easy analysis.

Use cases

  • Analyzing project dependencies to map module relationships and identify external packages.
  • Refactoring code by extracting and updating import paths across multiple files.
  • Auditing for unused imports to reduce bundle size and improve code cleanliness.

Examples

1. Extracting Dependencies from a React Component

Frontend Developer

Background

A developer is reviewing a React component file to list all imported modules for documentation.

Problem

Manually scanning the code for import statements is tedious and prone to errors.

How to use

Paste the component code into the tool and enable 'Include Node Modules' to capture all package imports.

Outcome

The tool outputs a JSON list of import paths like 'react' and './utils', with line numbers for quick reference.

2. Auditing TypeScript Code for Import Cleanup

Software Engineer

Background

An engineer is optimizing a TypeScript codebase before deployment to remove unnecessary imports.

Problem

Unused imports clutter the code and may increase the final bundle size.

How to use

Upload the TypeScript file and configure the tool to group results by import type for systematic review.

Outcome

Identifies all import statements, enabling the engineer to pinpoint and remove unused ones efficiently.

FAQ

What import types does this tool support?

It supports ES6 imports, TypeScript type-only imports, dynamic imports, CommonJS requires, and export-from statements.

Can I filter the extracted paths?

Yes, you can toggle options to include or exclude node modules and relative paths based on your needs.

What output format is provided?

The results are in JSON format, making it easy to parse, integrate, or further process the data.

Does it handle large codebases?

Yes, it efficiently processes large files with features like deduplication and line number tracking for accuracy.

Is TypeScript code fully supported?

Yes, the tool works seamlessly with both JavaScript and TypeScript, including type-only imports.

Home
Tools3212
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Development

Import Path Examples

Collection of JavaScript and TypeScript import examples demonstrating various import patterns and module systems

File System

Path Analyzer Samples

Comprehensive collection of file system paths from Windows, Linux, and macOS for path analysis and testing

Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

Documentation

Changelog Extractor Samples

Various changelog formats for testing changelog parsing and extraction tools

Development

Domain Extractor

Extract domain names from URLs. Supports various extraction options including subdomains and path analysis.

Development

CSS Selector Extractor

Extract and categorize all CSS selectors from CSS content

Development

Tailwind Color Palette Sync

Generate theme.extend.colors for tailwind.config.ts from HEX colors, with WCAG contrast levels and optional dark mode.

Text Processing

Date Extractor (日期提取器)

Extract dates from text in multiple formats including Chinese, ISO, and US formats with detailed analysis and summary