@dependents/detective-less

5.0.0 • Public • Published

@dependents/detective-less

CI npm version npm downloads

Find the dependencies of a less file

npm install @dependents/detective-less

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

It's the LESS counterpart to detective, detective-amd, and detective-es6.

Usage

const fs = require('fs');
const detective = require('@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 });

Options

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

License

MIT

Package Sidebar

Install

npm i @dependents/detective-less

Weekly Downloads

600,469

Version

5.0.0

License

MIT

Unpacked Size

6.45 kB

Total Files

4

Last publish

Collaborators

  • pahen
  • xhmikosr
  • mrjoelkemp