detective-scss

Find the dependencies of an scss file

MIT 19 个版本
安装
npm install detective-scss
yarn add detective-scss
pnpm add detective-scss
bun add detective-scss
README

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

ESM

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

CommonJS

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

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

版本列表
6.0.1 2026-05-26
6.0.0 2026-05-19
5.0.2 2026-04-25
5.0.1 2025-02-01
5.0.0 2024-04-14
4.0.3 2023-05-12
4.0.2 2023-05-11
4.0.1 2023-05-11
4.0.0 2023-05-05
3.1.1 2023-04-22
3.1.0 2023-04-22
3.0.2 2023-04-18
3.0.1 2023-03-19
3.0.0 2022-03-02
2.0.2 2022-02-22
2.0.1 2019-01-17
2.0.0 2018-09-03
1.0.1 2017-09-30
1.0.0 2016-12-31