# @dependents/detective-less

> Find the dependencies of a less file

Latest version **6.0.1** (published 2026-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dependents/detective-less
pnpm add @dependents/detective-less
yarn add @dependents/detective-less
bun add @dependents/detective-less
```

## Health

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

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

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2026-05-26 |
| First published | 2023-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 \|\| >=22.12.0 |
| Dependencies | 2 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Joel Kemp |
| Maintainers | pahen, mrjoelkemp, xhmikosr |
| Keywords | detective, less, ast, dependencies |

## Links

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

## Dependencies (2)

- [gonzales-pe](https://npm.io/package/gonzales-pe.md) ^4.3.0
- [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.1 (latest) — 2026-05-26
- 6.0.0 — 2026-05-19
- 5.0.3 — 2026-04-25
- 5.0.2 — 2026-04-20
- 5.0.1 — 2025-02-01
- 5.0.0 — 2024-04-14
- 4.1.0 — 2023-05-13
- 4.0.0 — 2023-05-05
- 3.0.2 — 2023-04-18
- 3.0.1 — 2023-03-18
- 3.0.0 — 2023-03-18

## README

# @dependents/detective-less

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

> Find the dependencies of a less file

```sh
npm install @dependents/detective-less
```

**Note:** This is specific to the .less style syntax.

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

* The AST is generated using the [gonzales-pe](https://github.com/tonyganch/gonzales-pe) parser.

## Usage

### ESM

```js
import fs from 'node:fs';
import detective from '@dependents/detective-less';

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

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

// or to also detect any url() references to images, fonts, etc.
const allDependencies = detective(content, { url: true });
```

### CommonJS

```js
const { default: detective } = require('@dependents/detective-less');
```

### Options

* `url` (optional): (`Boolean`) also detect any `url()` references to images, fonts, etc.

## License

[MIT](LICENSE)

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