# detective-stylus

> Get the dependencies of a Stylus file

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

## Install

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

## 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 | 2015-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 \|\| >=22.12.0 |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Joel Kemp |
| Maintainers | pahen, mrjoelkemp, xhmikosr |
| Keywords | stylus, ast, static, analysis, dependencies |

## Links

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

## 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.1 — 2025-02-01
- 5.0.0 — 2024-04-14
- 4.0.0 — 2023-05-05
- 3.0.0 — 2023-03-19
- 2.0.1 — 2022-03-19
- 2.0.0 — 2022-02-20
- 1.0.3 — 2022-02-20
- 1.0.2 — 2022-02-20
- 1.0.1 — 2022-02-19
- 1.0.0 — 2015-06-27

## README

# detective-stylus

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

> Find the dependencies of a Stylus file

```sh
npm install detective-stylus
```

It's the Stylus counterpart to
[detective](https://github.com/substack/node-detective),
[detective-amd](https://github.com/dependents/node-detective-amd),
[detective-es6](https://github.com/dependents/node-detective-es6),
and [detective-sass](https://github.com/dependents/node-detective-sass).

Note: this detective uses a regex to find the `@import` or `@require` statements.

## Usage

### ESM

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

const content = fs.readFileSync('styles.styl', 'utf8');

// list of imported file names (ex: '_foo.styl', '_foo', etc)
const dependencies = detective(content);
```

### CommonJS

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

## License

[MIT](LICENSE)

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