# @component-controls/follow-imports

> follow module imports until finding the file exporting the keyword

Latest version **4.0.3** (published 2022-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @component-controls/follow-imports
pnpm add @component-controls/follow-imports
yarn add @component-controls/follow-imports
bun add @component-controls/follow-imports
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2022-01-14 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 112.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Maintainers | atanasster |
| Keywords | babel, imports, exports |

## Links

- npm: https://www.npmjs.com/package/@component-controls/follow-imports
- Repository: https://github.com/ccontrols/component-controls
- Issues: https://github.com/ccontrols/component-controls/issues
- npm.io page: https://npm.io/package/@component-controls/follow-imports

## Dependencies (4)

- [typescript](https://npm.io/package/typescript.md) ^4.2.4
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.12.5
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) ^7.12.5
- [@structured-types/typescript-config](https://npm.io/package/@structured-types/typescript-config.md) ^3.16.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.0.3 (latest) — 2022-01-14

## README

# Table of contents

-   [Overview](#overview)
-   [Installation](#installation)
-   [API](#api)
    -   [defaultParserOptions](#defaultparseroptions)
    -   [defaultResolveOptions](#defaultresolveoptions)
    -   [ExportType](#exporttype)
    -   [parseFile](#parsefile)
    -   [extractImports](#extractimports)
    -   [extractExports](#extractexports)
    -   [sourceLocation](#sourcelocation)
    -   [getASTSource](#getastsource)
    -   [FollowImportType](#followimporttype)
    -   [EXPORT_ALL](#export_all)
    -   [EXPORT_DEFAULT](#export_default)
    -   [IMPORT_NAMESPACE](#import_namespace)
    -   [NamedExportTypes](#namedexporttypes)
    -   [ExportTypes](#exporttypes)
    -   [followImports](#followimports)
    -   [ImportType](#importtype)
    -   [ImportTypes](#importtypes)

# Overview

follow file imports using pabel ast parsing to find the file where an imported keyword was exported from (and is defined in).

# Installation

```bash
$ npm install @component-controls/follow-imports --save-dev
```

# API

<api-readme />

<!-- START-API-README -->

## defaultParserOptions

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L5)_

**properties**

| Name                             | Type                                        | Parent          | Default    | Description                                                                                                                                                                                                                                                                                                                        |
| -------------------------------- | ------------------------------------------- | --------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowImportExportEverywhere`    | `boolean`                                   | `ParserOptions` |            | By default, import and export declarations can only appear at a program's top level. Setting this option to true allows them anywhere where a statement is allowed.                                                                                                                                                                |
| `allowAwaitOutsideFunction`      | `boolean`                                   | `ParserOptions` |            | By default, await use is not allowed outside of an async function. Set this to true to accept such code.                                                                                                                                                                                                                           |
| `allowReturnOutsideFunction`     | `boolean`                                   | `ParserOptions` |            | By default, a return statement at the top level raises an error. Set this to true to accept such code.                                                                                                                                                                                                                             |
| `allowSuperOutsideMethod`        | `boolean`                                   | `ParserOptions` |            |                                                                                                                                                                                                                                                                                                                                    |
| `allowUndeclaredExports`         | `boolean`                                   | `ParserOptions` |            | By default, exported identifiers must refer to a declared variable. Set this to true to allow export statements to reference undeclared variables.                                                                                                                                                                                 |
| `attachComment`                  | `boolean`                                   | `ParserOptions` |            | By default, Babel attaches comments to adjacent AST nodes. When this option is set to false, comments are not attached. It can provide up to 30% performance improvement when the input code has many comments.                                                                                                                    |
| `errorRecovery`                  | `boolean`                                   | `ParserOptions` |            | By default, Babel always throws an error when it finds some invalid code. When this option is set to true, it will store the parsing error and try to continue parsing the invalid input file.                                                                                                                                     |
| `sourceType`                     | `"script"` \| `"module"` \| `"unambiguous"` | `ParserOptions` | `"module"` | Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". Defaults to "script". "unambiguous" will make @babel/parser attempt to guess, based on the presence of ES6 import or export statements. Files with ES6 imports and exports are considered "module" and are otherwise "script". |
| `sourceFilename`                 | `string`                                    | `ParserOptions` |            | Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files.                                                                                                                                                                                          |
| `startLine`                      | `number`                                    | `ParserOptions` |            | By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools.                                                                                                                                                         |
| `plugins`                        | `ParserPlugin`\[]                           | `ParserOptions` |            | Array containing the plugins that you want to enable.                                                                                                                                                                                                                                                                              |
| `strictMode`                     | `boolean`                                   | `ParserOptions` |            | Should the parser work in strict mode. Defaults to true if sourceType === 'module'. Otherwise, false.                                                                                                                                                                                                                              |
| `ranges`                         | `boolean`                                   | `ParserOptions` |            | Adds a ranges property to each node: \[node.start, node.end]                                                                                                                                                                                                                                                                       |
| `tokens`                         | `boolean`                                   | `ParserOptions` |            | Adds all parsed tokens to a tokens property on the File node.                                                                                                                                                                                                                                                                      |
| `createParenthesizedExpressions` | `boolean`                                   | `ParserOptions` |            | By default, the parser adds information about parentheses by setting  `extra.parenthesized`  to  `true`  as needed. When this option is  `true`  the parser creates  `ParenthesizedExpression`  AST nodes instead of using the  `extra`  property.                                                                                 |

## defaultResolveOptions

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L16)_

**extends**

`Opts`

**properties**

| Name               | Type                                                                                                          | Parent     | Default                                                                                                                           | Description                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `readFileSync`     | **function** (<br />`file`\*: `string`<br />`charset`\*: `string`<br />) => `string` \| `Buffer`              | `SyncOpts` |                                                                                                                                   | how to read files synchronously (defaults to fs.readFileSync)                                                                                                                                                                                                                                                                                          |
| `isFile`           | **function** (<br />`file`\*: `string`<br />) => `boolean`                                                    | `SyncOpts` |                                                                                                                                   | function to synchronously test whether a file exists                                                                                                                                                                                                                                                                                                   |
| `basedir`          | `string`                                                                                                      | `Opts`     |                                                                                                                                   | directory to begin resolving from (defaults to \_\_dirname)                                                                                                                                                                                                                                                                                            |
| `package`          | `any`                                                                                                         | `Opts`     |                                                                                                                                   | package.json data applicable to the module being loaded                                                                                                                                                                                                                                                                                                |
| `extensions`       | `string` \| `ReadonlyArray`&lt;`string`>                                                                      | `Opts`     | `[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]` | array of file extensions to search in order (defaults to \['.js'])                                                                                                                                                                                                                                                                                     |
| `packageFilter`    | **function** (<br />`pkg`\*: `any`<br />`pkgfile`\*: `string`<br />) => `any`                                 | `Opts`     |                                                                                                                                   | transform the parsed package.json contents before looking at the "main" field                                                                                                                                                                                                                                                                          |
| `pathFilter`       | **function** (<br />`pkg`\*: `any`<br />`path`\*: `string`<br />`relativePath`\*: `string`<br />) => `string` | `Opts`     |                                                                                                                                   | transform a path within a package                                                                                                                                                                                                                                                                                                                      |
| `paths`            | `string` \| `ReadonlyArray`&lt;`string`>                                                                      | `Opts`     |                                                                                                                                   | require.paths array to use if nothing is found on the normal node_modules recursive walk (probably don't use this)                                                                                                                                                                                                                                     |
| `moduleDirectory`  | `string` \| `ReadonlyArray`&lt;`string`>                                                                      | `Opts`     |                                                                                                                                   | directory (or directories) in which to recursively look for modules. (default to 'node_modules')                                                                                                                                                                                                                                                       |
| `preserveSymlinks` | `boolean`                                                                                                     | `Opts`     |                                                                                                                                   | if true, doesn't resolve  `basedir`  to real path before resolving. This is the way Node resolves dependencies when executed with the --preserve-symlinks flag.  Note: this property is currently true by default but it will be changed to false in the next major version because Node's resolution algorithm does not preserve symlinks by default. |

## ExportType

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L20)_

**properties**

| Name            | Type                                                                                                                                                                                                                                                                                                                  | Description                                                                                     |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `name*`         | `string`                                                                                                                                                                                                                                                                                                              |                                                                                                 |
| `internalName*` | `string`                                                                                                                                                                                                                                                                                                              |                                                                                                 |
| `loc`           | <details><summary>`SourceLocation`</summary><blockquote><details><summary>`start`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details><details><summary>`end`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details></blockquote></details> |                                                                                                 |
| `from`          | `string`                                                                                                                                                                                                                                                                                                              | in case of export { Button } from './button-named-export'; specifies the import from statememnt |
| `node`          | `any`                                                                                                                                                                                                                                                                                                                 |                                                                                                 |
| `path`          | `any`                                                                                                                                                                                                                                                                                                                 |                                                                                                 |

## parseFile

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/ast_store.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/ast_store.ts#L15)_

**parameters**

| Name         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Default |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `filePath*`  | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |         |
| `options`    | <details><summary>`parser.ParserOptions`</summary><blockquote>`allowImportExportEverywhere`: `boolean`<br />`allowAwaitOutsideFunction`: `boolean`<br />`allowReturnOutsideFunction`: `boolean`<br />`allowSuperOutsideMethod`: `boolean`<br />`allowUndeclaredExports`: `boolean`<br />`attachComment`: `boolean`<br />`errorRecovery`: `boolean`<br />`sourceType`: `"script"` \| `"module"` \| `"unambiguous"`<br />`sourceFilename`: `string`<br />`startLine`: `number`<br />`plugins`: `ParserPlugin`\[]<br />`strictMode`: `boolean`<br />`ranges`: `boolean`<br />`tokens`: `boolean`<br />`createParenthesizedExpressions`: `boolean`</blockquote></details>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |         |
| `sourceCode` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |         |
| `cache*`     | `boolean`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | `true`  |
| `returns`    | <details><summary>`CacheProps`</summary><blockquote><details><summary>`ast`\*</summary><blockquote>`type`\*: `string`<br /><details><summary>`program`\*</summary><blockquote>`type`\*: `string`<br />`body`\*: `Statement`\[]<br />`directives`\*: `Directive`\[]<br />`sourceType`\*: `"script"` \| `"module"`<br />`interpreter`: `InterpreterDirective` \| `null`<br />`sourceFile`\*: `string`<br />`leadingComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`innerComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`trailingComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`start`\*: `number` \| `null`<br />`end`\*: `number` \| `null`<br />`loc`\*: `SourceLocation` \| `null`<br />`range`: \[`number`, `number`]<br />`extra`: `Record`&lt;`string`, `unknown`></blockquote></details>`comments`: ((`CommentBlock`, `CommentLine`))\[] \| `null`<br />`tokens`: `any`\[] \| `null`<br />`leadingComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`innerComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`trailingComments`\*: `ReadonlyArray`&lt;`Comment`> \| `null`<br />`start`\*: `number` \| `null`<br />`end`\*: `number` \| `null`<br />`loc`\*: `SourceLocation` \| `null`<br />`range`: \[`number`, `number`]<br />`extra`: `Record`&lt;`string`, `unknown`></blockquote></details>`source`\*: `string`<br />`imports`: [`ImportTypes`](#importtypes)<br />`exports`: [`ExportTypes`](#exporttypes)<br />`importAliases`: `Record`&lt;`string`, `string`></blockquote></details> |         |

## extractImports

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/extract-imports.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/extract-imports.ts#L19)_

**parameters**

| Name        | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fileName*` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `options*`  | <details><summary>`ParserOptions`</summary><blockquote>`allowImportExportEverywhere`: `boolean`<br />`allowAwaitOutsideFunction`: `boolean`<br />`allowReturnOutsideFunction`: `boolean`<br />`allowSuperOutsideMethod`: `boolean`<br />`allowUndeclaredExports`: `boolean`<br />`attachComment`: `boolean`<br />`errorRecovery`: `boolean`<br />`sourceType`: `"script"` \| `"module"` \| `"unambiguous"`<br />`sourceFilename`: `string`<br />`startLine`: `number`<br />`plugins`: `ParserPlugin`\[]<br />`strictMode`: `boolean`<br />`ranges`: `boolean`<br />`tokens`: `boolean`<br />`createParenthesizedExpressions`: `boolean`</blockquote></details> |
| `returns`   | [`ImportTypes`](#importtypes)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## extractExports

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/extract-exports.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/extract-exports.ts#L32)_

**parameters**

| Name        | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fileName*` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `options*`  | <details><summary>`ParserOptions`</summary><blockquote>`allowImportExportEverywhere`: `boolean`<br />`allowAwaitOutsideFunction`: `boolean`<br />`allowReturnOutsideFunction`: `boolean`<br />`allowSuperOutsideMethod`: `boolean`<br />`allowUndeclaredExports`: `boolean`<br />`attachComment`: `boolean`<br />`errorRecovery`: `boolean`<br />`sourceType`: `"script"` \| `"module"` \| `"unambiguous"`<br />`sourceFilename`: `string`<br />`startLine`: `number`<br />`plugins`: `ParserPlugin`\[]<br />`strictMode`: `boolean`<br />`ranges`: `boolean`<br />`tokens`: `boolean`<br />`createParenthesizedExpressions`: `boolean`</blockquote></details> |
| `returns`   | [`ExportTypes`](#exporttypes)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## sourceLocation

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/source-location.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/source-location.ts#L3)_

**parameters**

| Name      | Type                            |
| --------- | ------------------------------- |
| `loc*`    | `SourceLocation` \| `null`      |
| `returns` | `SourceLocation` \| `undefined` |

## getASTSource

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/source.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/source.ts#L3)_

**parameters**

| Name      | Type                                                                                                                                                                                                                                                                                                                  |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source`  | `string`                                                                                                                                                                                                                                                                                                              |
| `loc`     | <details><summary>`SourceLocation`</summary><blockquote><details><summary>`start`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details><details><summary>`end`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details></blockquote></details> |
| `returns` | `string` \| `undefined`                                                                                                                                                                                                                                                                                               |

## FollowImportType

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/index.ts#L27)_

**properties**

| Name           | Type                                                                                                                                                                                                                                                                                                                  |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `exportedAs`   | `string`                                                                                                                                                                                                                                                                                                              |
| `internalName` | `string`                                                                                                                                                                                                                                                                                                              |
| `from`         | `string`                                                                                                                                                                                                                                                                                                              |
| `filePath`     | `string`                                                                                                                                                                                                                                                                                                              |
| `importedName` | `string`                                                                                                                                                                                                                                                                                                              |
| `loc`          | <details><summary>`SourceLocation`</summary><blockquote><details><summary>`start`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details><details><summary>`end`\*</summary><blockquote>`line`\*: `number`<br />`column`\*: `number`</blockquote></details></blockquote></details> |
| `source`       | `string`                                                                                                                                                                                                                                                                                                              |
| `imported`     | `string`                                                                                                                                                                                                                                                                                                              |
| `imports`      | [`ImportTypes`](#importtypes)                                                                                                                                                                                                                                                                                         |
| `node`         | `any`                                                                                                                                                                                                                                                                                                                 |
| `path`         | `any`                                                                                                                                                                                                                                                                                                                 |

## EXPORT_ALL

**`string` = "\*"**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L32)_

## EXPORT_DEFAULT

**`string` = "default"**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L33)_

## IMPORT_NAMESPACE

**`string` = "namespace"**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L35)_

## NamedExportTypes

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L37)_

**properties**

| Name   | Type                                           |
| ------ | ---------------------------------------------- |
| `key*` | \[`string`]: [`ExportType`](#exporttype)<br /> |

## ExportTypes

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L40)_

**properties**

| Name       | Type                                    |
| ---------- | --------------------------------------- |
| `default*` | [`NamedExportTypes`](#namedexporttypes) |
| `named*`   | [`NamedExportTypes`](#namedexporttypes) |

## followImports

**`function`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/index.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/index.ts#L41)_

**parameters**

| Name          | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `importName*` | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `filePath*`   | `string`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `options`     | <details><summary>`type`</summary><blockquote><details><summary>`parser`</summary><blockquote>`allowImportExportEverywhere`: `boolean`<br />`allowAwaitOutsideFunction`: `boolean`<br />`allowReturnOutsideFunction`: `boolean`<br />`allowSuperOutsideMethod`: `boolean`<br />`allowUndeclaredExports`: `boolean`<br />`attachComment`: `boolean`<br />`errorRecovery`: `boolean`<br />`sourceType`: `"script"` \| `"module"` \| `"unambiguous"`<br />`sourceFilename`: `string`<br />`startLine`: `number`<br />`plugins`: `ParserPlugin`\[]<br />`strictMode`: `boolean`<br />`ranges`: `boolean`<br />`tokens`: `boolean`<br />`createParenthesizedExpressions`: `boolean`</blockquote></details><details><summary>`resolver`</summary><blockquote>`readFileSync`: **function** (<br />`file`\*: `string`<br />`charset`\*: `string`<br />) => `string` \| `Buffer`<br />`isFile`: **function** (<br />`file`\*: `string`<br />) => `boolean`<br />`basedir`: `string`<br />`package`: `any`<br />`extensions`: `string` \| `ReadonlyArray`&lt;`string`><br />`packageFilter`: **function** (<br />`pkg`\*: `any`<br />`pkgfile`\*: `string`<br />) => `any`<br />`pathFilter`: **function** (<br />`pkg`\*: `any`<br />`path`\*: `string`<br />`relativePath`\*: `string`<br />) => `string`<br />`paths`: `string` \| `ReadonlyArray`&lt;`string`><br />`moduleDirectory`: `string` \| `ReadonlyArray`&lt;`string`><br />`preserveSymlinks`: `boolean`</blockquote></details>`resolveFile`: **function** (<br />`importName`\*: `string`<br />`filePath`\*: `string`<br />) => `string` \| `undefined`</blockquote></details> |
| `returns`     | [`FollowImportType`](#followimporttype) \| `undefined`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

## ImportType

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L45)_

**properties**

| Name            | Type     | Description                                                                       |
| --------------- | -------- | --------------------------------------------------------------------------------- |
| `name*`         | `string` | component name                                                                    |
| `importedName*` | `string` | importedName - the original named import that was aliased                         |
| `from*`         | `string` | imported from                                                                     |
| `typesFile`     | `string` | imported from alias file name ie '/component-controls/core/store/dist/index.d.ts' |
| `componentKey`  | `string` | key into components table                                                         |

## ImportTypes

**`interface`**

_defined in [@component-controls/follow-imports/misc/follow-imports/src/consts.ts](https://github.com/ccontrols/component-controls/tree/master/misc/follow-imports/src/consts.ts#L70)_

**properties**

| Name   | Type                                           |
| ------ | ---------------------------------------------- |
| `key*` | \[`string`]: [`ImportType`](#importtype)<br /> |

<!-- END-API-README -->

---
_Source: https://npm.io/package/@component-controls/follow-imports · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
