detective-scss

5.0.0 • Public • Published

detective-scss

CI npm version npm downloads

Find the dependencies of an scss file

npm install detective-scss

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

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

Usage

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

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

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

/detective-scss/

    Package Sidebar

    Install

    npm i detective-scss

    Weekly Downloads

    849,280

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    6.67 kB

    Total Files

    4

    Last publish

    Collaborators

    • pahen
    • xhmikosr
    • mrjoelkemp