# imports-walk-ts

> Find 'import' and 're-export' statements in typescript using babel parser.

Latest version **1.0.0** (published 2023-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install imports-walk-ts
pnpm add imports-walk-ts
yarn add imports-walk-ts
bun add imports-walk-ts
```

## 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 | 1.0.0 |
| Published | 2023-10-17 |
| First published | 2023-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | mrozio13pl |
| Maintainers | mrozio |
| Keywords | require, import, modules, detective, typescript |

## Links

- npm: https://www.npmjs.com/package/imports-walk-ts
- Repository: https://github.com/mrozio13pl/imports-walk-ts
- Homepage: https://github.com/mrozio13pl/imports-walk-ts#readme
- Issues: https://github.com/mrozio13pl/imports-walk-ts/issues
- npm.io page: https://npm.io/package/imports-walk-ts

## Dependencies (1)

- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.23.0

## 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

- 1.0.0 (latest) — 2023-10-17

## README

# imports-walk-ts

> Find `import` and `re-export` statements in typescript using [babel parser](https://babeljs.io/docs/babel-parser).

## Install

```bash
npm i imports-walk-ts
```

## Usage

`source.ts`
```ts
import moduleA from './module-a';
import moduleB from './module-b';
import moduleC = require('./module-c');
export * from './module-d';
```

`program.ts`
```ts
import importsWalkTs from 'imports-walk-ts';
import fs from 'fs';
const source = fs.readFileSync('source.ts', 'utf8');

importsWalkTs(source); // <= ['./module-a', './module-b', './module-c', './module-d']
```

## API

### `importsWalkTs(src, options?)`

Looks for `import` and `re-export` statements.

#### `src`

Type: `String`<br>
Source, where `import` and `re-export` statements will be looked for.

#### `options`

Type: `Object`<br>
Options are the same as [babel parser options](https://babeljs.io/docs/babel-parser#options).

## Related

- [imports-walk](https://github.com/mrozio13pl/imports-walk) - Find `import` and `re-export` statements of an ES6 module.
- [requires-walk](https://github.com/mrozio13pl/requires-walk) - Find `require()` calls.

## License

MIT 💖

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