Socket
Book a DemoInstallSign in
Socket

detective-scss

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective-scss

Find the dependencies of an scss file

latest
Source
npmnpm
Version
5.0.1
Version published
Weekly downloads
2.9M
-5.39%
Maintainers
3
Weekly downloads
 
Created
Source

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.

  • The AST is generated using the gonzales-pe parser.

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.
  • 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

Keywords

detective

FAQs

Package last updated on 01 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts