1.1.7 • Published 6 years ago

qw-find-imports v1.1.7

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

find-imports

Find require and import dynamic-import files of JavaScript file by ast

Feature

  1. find imports by filename
  2. support dynamic import
  3. support files js jsx ts tsx
  4. find imports files and child by entry file, eg: webpack entry

Usage

Install package npm install qw-find-imports

import { findImports } from "qw-find-imports";

const strs2 = findImports(
  "XXXXXXXX/index.js",
  {
    findChild: true,
    log: false,
    baseUrl: ["XXXXXXXX"]
  }
);

console.log(JSON.stringify(strs2, null, 2));