Skip to content

Repository files navigation

@dependents/detective-less

CInpm versionnpm 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

constfs=require('fs');constdetective=require('@dependents/detective-less');constcontent=fs.readFileSync('styles.less','utf8');// list of imported file names (ex: 'foo.less', 'foo', etc)constdependencies=detective(content);// or to also detect any url() references to images, fonts, etc.constallDependencies=detective(content,{url: true});

Options

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

License

MIT

About

Grab the dependencies of a Less file by traversing its AST

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages