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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@thezebra/sass-affected

v1.2.0

Published

Map SASS file changes to the root file(s) that are affected, helping create more efficient regression tests.

Downloads

5

Readme

sass-affected

Map Sass file changes to the root file(s) that are affected, helping create more efficient regression tests.

Why?

One can use sass-graph as a CLI tool to find the ancestors of a Sass file. This will list every intermediary file as well as the root(s). sass-affected aims to show the root Sass file so that developers or QA teams can identify which templates are affected by changing any ol' Sass file in a project.

Requirements

The CLI tool is built to support Node 6.x runtimes. The Node library is exposed in CommonJS format for Node 6.x and in ES2015 format if you need to bundle it for other runtimes.

Installation

With npm:

$ npm install @thezebra/sass-affected --save-dev

With yarn:

$ yarn add @thezebra/sass-affected --dev

Usage

This tool only finds root Sass files. It is not wired up to version control, CI, or any sort of build process out of the box. You will have to integrate it into your teams processes to get any benefit.

Use it as a CLI tool

sass-affected --dir src/scss --changed src/scss/helpers/_utils.scss

Let the tool diff against a branch:

sass-affected --dir src/scss --branch origin/master

Use it as a Node library

import sassAffected from "sass-affected";

// This returns a Promise
sassAffected("mocks", ["mocks/rootA.scss"]).then(obj => {
  // The output will be an array of roots with their corresponding message:
  // [{ file, message }]
  console.log(obj);
});

Add the following magic comment to the top of your root Sass files to customize the regression check message:

// sass-affected /homepage.html should be checked for regressions!

Contributing

sass-affected is meant to be used as a helpful library in a team's development and QA process. The most helpful contributions are separate modules, scripts, etc that allow development and QA teams to integrate the helpful regression messages without extra work. That said, if you have suggestions and improvements to this library, please feel welcome!

See our contributing guide for details.