# jscodeshift-build-import-list

> build a list of all files and dependencies transitively imported by starting file(s)

Latest version **1.4.1** (published 2021-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install jscodeshift-build-import-list
pnpm add jscodeshift-build-import-list
yarn add jscodeshift-build-import-list
bun add jscodeshift-build-import-list
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2021-12-07 |
| First published | 2018-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 8 |
| Unpacked size | 367.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Andy Edwards |
| Maintainers | jedwards1211 |
| Keywords | jscodeshift |

## Links

- npm: https://www.npmjs.com/package/jscodeshift-build-import-list
- Repository: https://github.com/codemodsquad/jscodeshift-build-import-list
- Homepage: https://github.com/codemodsquad/jscodeshift-build-import-list#readme
- Issues: https://github.com/codemodsquad/jscodeshift-build-import-list/issues
- npm.io page: https://npm.io/package/jscodeshift-build-import-list

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) ^7.1.3
- [resolve](https://npm.io/package/resolve.md) ^1.17.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.16.0
- [jscodeshift](https://npm.io/package/jscodeshift.md) ^0.13.0
- [es6-promisify](https://npm.io/package/es6-promisify.md) ^6.0.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.16.4
- [babel-parse-wild-code](https://npm.io/package/babel-parse-wild-code.md) ^1.1.1

## Recent versions

- 1.4.1 (latest) — 2021-12-07
- 1.4.0 — 2021-12-07
- 1.3.0 — 2020-11-24
- 1.2.0 — 2020-09-29
- 1.1.2 — 2020-05-07
- 1.1.1 — 2019-01-28
- 1.1.0 — 2018-10-09
- 1.0.0 — 2018-10-08

## README

# jscodeshift-build-import-list

[![CircleCI](https://circleci.com/gh/codemodsquad/jscodeshift-build-import-list.svg?style=svg)](https://circleci.com/gh/codemodsquad/jscodeshift-build-import-list)
[![Coverage Status](https://codecov.io/gh/codemodsquad/jscodeshift-build-import-list/branch/master/graph/badge.svg)](https://codecov.io/gh/codemodsquad/jscodeshift-build-import-list)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/jscodeshift-build-import-list.svg)](https://badge.fury.io/js/jscodeshift-build-import-list)

build a list of all files and dependencies transitively imported by starting file(s)

# Installation

```sh
npm install --save-dev jscodeshift-build-import-list
```

# Limitations

Requires Node >= 8.

Dynamic `require()` and `import()` paths are not supported; an `Error` will be
thrown if dynamic path is encountered (unless you have a leading comment containing
`@jscodeshift-build-import-list ignore`).

However, calls to [`require-glob`](https://github.com/shannonmoeller/require-glob)
with a string literal argument are supported.

# API

## `buildImportList(files)`

Builds a list of all files and npm packages imported from the given `files`,
the files imported by them, and sort forth.

### `files` (`string | string[]`)

The file(s) to start from.

### Returns (`Promise<{files: Set<string>, dependencies: Set<string>}>`)

A `Promise` that will resolve to an object with two properties:

#### `files`

A `Set` of local files transitively imported by the starting file(s)

#### `dependencies`

A `Set` of npm packages transitively imported by the starting file(s)

### Ignoring requires/imports

Add a leading comment containing `@jscodeshift-build-import-list ignore`, for example:

```js
// @jscodeshift-build-import-list ignore
import foo from 'foo'
const bar = /* @jscodeshift-build-import-list ignore */ require(getBarPath())
```

---
_Source: https://npm.io/package/jscodeshift-build-import-list · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
