npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@orbit-tech/sass-unused-recursive

v0.1.0

Published

[![Build Status](https://travis-ci.org/orbit-tech/sass-unused-recursive.png?branch=master)](https://travis-ci.org/orbit-tech/sass-unused-recursive)

Readme

Sass unused variables check

Build Status

This tool will help you determine variables which are not defined in your Sass (Syntactically awesome stylesheets) project.

  • It resolves the dependencies in import statements then validates those same import statements using sass-graph.
  • It resolves and validates included paths in your project.

Install

Add sass-unused-recursive into your project as a developer dependency.

npm install @orbit-tech/sass-unused-recursive --save-dev

Usage

Create a file which imports sass-unused-recursive library and then you can validate your project by passing the location of the entry file:

let sassUnused = require('@orbit-tech/sass-unused-recursive');

let result = sassUnused('./path/to/entry/file.scss'); // [ 'unused-variable-one' ]

Options

All options are passed as an object in the first argument. Let's assume following directory structure:

├── theme.scss
├── themes                          <-- Theming
|  ├── _one.scss
|  └── _two.scss
├── vendor                          <-- This is included path (3rd party code)
|  └── orbit
|     ├── _components.scss
|     ├── _hello-component.scss
|     └── _settings.scss
├── _components.scss
├── _main.scss                      <-- Here is the entry file
├── _settings.scss
└── _tools.scss

entry

Specify the path of the scss entry file:

Type: String

let result = sassUnused({
    entry: './_main.scss'
});

entries

Sometimes you might have multiple entries for your code. If this is the case, you can validate them all by defining a path to the themes directory:

Type: String

let result = sassUnused({
    entries: './themes'
});

includePaths

When your code contains external include paths to other directories, you can also configure those:

Type: Array

let result = sassUnused({
    includePaths: [ './vendor' ]
});

exclude

Use this option to filter the results from unused mixins, functions or vendor definitions:

Type: Array<'functions', 'mixins', 'vendor'>

let result = sassUnused({
    exclude: [ 'functions', 'mixins', 'vendor' ]
});

Example

A fully configured example for the files in the fixtures directory structure is defined above (see also example/app.js):

let sassUnused = require('@orbit-tech/sass-unused-recursive');

let result = sassUnused({
    entries: './fixtures/themes',
    includePaths: './fixtures/vendor',
    exclude: [ 'vendor' ]
});

console.log('Unused variables are:\n');
console.log(JSON.stringify(result, null, 4));

You can run this example by executing the following command:

$ node example/app.js
Unused variables are:

{
    '__common': [                   <-- Those are variables which are not defined in every entry point
        'app-s-variable-not-used',
        'mixin-not-used'
    ],
    '_one.scss': [                  <-- Those are variables not defined in particular entry
        'foo'
    ]
}

Running the tests

You can run the tests by executing the following commands:

git clone [email protected]:orbit-tech/sass-unused-recursive.git
cd sass-unused-recursive
npm install
npm test

Contributing to the project

Thanks for reading this far. If you have any improvements to suggest for this project, please raise an issue/pull request.