detective-sass

6.0.0 • Public • Published

detective-sass

CI npm version npm downloads

Find the dependencies of a sass file

npm install detective-sass

Note: This is specific to the .sass style syntax of the Sass preprocessor. For SCSS support, please see node-detective-scss.

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

Usage

const fs = require('fs');
const detective = require('detective-sass');

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

// list of imported file names (ex: '_foo.sass', '_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.

Related

  • node-sass-lookup if you want to map a sass/scss dependency to a file on your filesystem.
  • node-precinct if you want to also support finding dependencies for JavaScript and other languages.

License

MIT

Package Sidebar

Install

npm i detective-sass

Weekly Downloads

1,140,509

Version

6.0.0

License

MIT

Unpacked Size

6.65 kB

Total Files

4

Last publish

Collaborators

  • pahen
  • xhmikosr
  • mrjoelkemp