# detective-es6

> Get the dependencies of an ES6 module

Latest version **6.0.0** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install detective-es6
pnpm add detective-es6
yarn add detective-es6
bun add detective-es6
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-05-19 |
| First published | 2014-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 \|\| >=22.12.0 |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Author | Joel Kemp |
| Maintainers | pahen, mrjoelkemp, xhmikosr |
| Keywords | detective, es6, es2015, dependencies, module, ast, import |

## Links

- npm: https://www.npmjs.com/package/detective-es6
- Repository: https://github.com/dependents/node-detective-es6
- Issues: https://github.com/dependents/node-detective-es6/issues
- npm.io page: https://npm.io/package/detective-es6

## Dependencies (1)

- [node-source-walk](https://npm.io/package/node-source-walk.md) ^8.0.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 6.0.0 (latest) — 2026-05-19
- 5.0.2 — 2026-04-20
- 5.0.1 — 2025-02-01
- 5.0.0 — 2024-04-14
- 4.0.1 — 2023-05-12
- 4.0.0 — 2023-05-05
- 3.0.1 — 2023-03-19
- 3.0.0 — 2022-03-03
- 2.2.2 — 2022-02-22
- 2.2.1 — 2021-11-11
- 2.2.0 — 2020-06-27
- 2.1.0 — 2019-03-09
- 2.0.0 — 2018-09-03
- 1.2.0 — 2017-08-27
- 1.1.6 — 2016-09-25
- … 10 more at https://npm.io/package/detective-es6/versions

## README

# detective-es6

[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-es6/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-es6/actions/workflows/ci.yml?query=branch%3Amain)
[![npm version](https://img.shields.io/npm/v/detective-es6?logo=npm&logoColor=fff)](https://www.npmjs.com/package/detective-es6)
[![npm downloads](https://img.shields.io/npm/dm/detective-es6)](https://www.npmjs.com/package/detective-es6)

> Get the dependencies of an ES6 module

```sh
npm install detective-es6
```

## Usage

### ESM

```js
import fs from 'node:fs';
import detective from 'detective-es6';

const mySourceCode = fs.readFileSync('myfile.js', 'utf8');

// Pass in a file's content or an AST
const dependencies = detective(mySourceCode);
```

### CommonJS

```js
const { default: detective } = require('detective-es6');
```

* Supports JSX, Flow, and any other features that [node-source-walk](https://github.com/dependents/node-source-walk) supports.

You may also (optionally) configure the detective via a second object argument detective(src, options) that supports the following options:

- `skipTypeImports`: (Boolean) whether or not to omit type imports (`import type {foo} from "mylib";`) in the list of extracted dependencies.
- `skipAsyncImports`: (Boolean) whether or not to omit async imports (`import('foo')`) in the list of extracted dependencies.

## License

[MIT](LICENSE)

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