detective-sass

Find the dependencies of a sass file

MIT 30 个版本
安装
npm install detective-sass
yarn add detective-sass
pnpm add detective-sass
bun add detective-sass
README

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

ESM

import fs from 'node:fs';
import detective from '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 });

CommonJS

const { default: detective } = require('detective-sass');

Options

  • url (optional): (Boolean) also detect any url() references to images, fonts, etc.
  • 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

版本列表
7.0.1 2026-05-26
7.0.0 2026-05-19
6.0.2 2026-04-25
6.0.1 2025-02-01
6.0.0 2024-04-14
5.0.3 2023-05-12
5.0.2 2023-05-11
5.0.1 2023-05-11
5.0.0 2023-05-05
4.1.3 2023-04-22
4.1.2 2023-04-18
4.1.1 2023-03-19
4.1.0 2023-03-13
4.0.1 2022-03-03
4.0.0 2022-03-03
3.0.2 2022-02-22
3.0.1 2019-01-17
3.0.0 2018-09-06
2.0.1 2017-09-30
2.0.0 2016-12-31
1.2.2 2016-12-27
1.2.1 2016-09-05
1.2.0 2016-07-17
1.1.0 2016-07-05
1.0.4 2016-06-21
1.0.3 2016-06-19
1.0.2 2015-06-27
1.0.1 2014-11-27
1.0.0 2014-11-17
0.0.0 2014-11-13