# babel-dependency-parser

> Parse require calls and return used dependencies

Latest version **1.1.0** (published 2020-05-27) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install babel-dependency-parser
pnpm add babel-dependency-parser
yarn add babel-dependency-parser
bun add babel-dependency-parser
```

## 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.1.0 |
| Published | 2020-05-27 |
| First published | 2020-05-27 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | f0x |
| Maintainers | f0x52 |
| Keywords | babel, dependency, plugin |

## Links

- npm: https://www.npmjs.com/package/babel-dependency-parser
- Repository: https://git.pixie.town/f0x/babel-dependency-parser
- npm.io page: https://npm.io/package/babel-dependency-parser

## Dependencies (1)

- [@babel/helper-plugin-utils](https://npm.io/package/@babel/helper-plugin-utils.md) ^7.8.3

## 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.1.0 (latest) — 2020-05-27
- 1.0.0 — 2020-05-27

## README

# Babel Dependency Parser

Simple babel plugin that parses all dependencies of the passed code.

Use:
```javascript
"use strict";

const babel = require('@babel/core');
const dependencyParser = require('babel-dependency-parser');

let code = `let React = require('react');`;

let dependencies = [];
babel.transform(code, {
	plugins: [dependencyParser(dependencies)]
});

console.log(dependencies); // [ 'react' ]
```

If you need to parse CommonJS `import` statements, make sure to also add [@babel/plugin-transform-modules-commonjs](https://www.npmjs.com/package/@babel/plugin-transform-modules-commonjs).

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