detective-sass
Find the dependencies of a sass file by traversing the AST.
Last updated 10 years ago by mrjoelkemp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install detective-sass 
SYNC missed versions from official npm registry.

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

Current Tags

  • 6.0.0                                ...           latest (8 months ago)

26 Versions

  • 6.0.0                                ...           8 months ago
  • 5.0.3                                ...           2 years ago
  • 5.0.2                                ...           2 years ago
  • 5.0.1                                ...           2 years ago
  • 5.0.0                                ...           2 years ago
  • 4.1.3                                ...           2 years ago
  • 4.1.2                                ...           2 years ago
  • 4.1.1                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0 [deprecated]           ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.2.2                                ...           8 years ago
  • 1.2.1                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 1.0.4                                ...           9 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 4
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE