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

sass-globber

v2.0.2

Published

This module provides a simple globbing functionality for sass files like the ruby gem sass-globbing. It reads a file from a defined directory and creates a new sass file with all `@import` statements.

Downloads

248

Readme

Sass Globber

This module provides a simple globbing functionality for sass files like the ruby gem sass-globbing.

It reads a file from a defined directory and creates a new sass file with all @import statements.

It also has a build-in watcher which watches your changes in your sassRoot directory.

Installation

npm install sass-globber

Usage

Read a source file from a provided directory, process its content, glob all files and output the paths as content to a custom output file.


var sassGlobbing = require('sass-globber');

sassGlobbing.compiled({
	sassRoot: 'src/sass',
	source: "_all.scss",
	output: 'styles.scss'
});

When your Sass/SCSS file looks like this:

@import "../bower-components/pg-scss/resources/scss/pg-reset";
@import "../bower-components/pg-scss/resources/scss/_helpers/**/*";
@import "global/vars";
@import "../bower-components/pg-scss/resources/scss/pg";

@import "utils/**/*";

@import "global/base";
@import "global/font-face";
@import "global/modifiers";
@import "global/get-media";

@import "regions**/*";

@import "components/**/*";

@import "panels/**/*";

@import "blocks/**/*";

@import "global/print";

You will get the following output:

// This file is generated by sass-globber.
// Do not edit this file manually!
// Just add your styles/imports to your source file: styles.scss.

@import "../bower-components/pg-scss/resources/scss/pg-reset";
@import "../bower-components/pg-scss/resources/scss/_helpers/_breakpoint";
@import "../bower-components/pg-scss/resources/scss/_helpers/_cp";
@import "global/vars";
@import "../bower-components/pg-scss/resources/scss/pg";

@import "utils/extends/_ex-fonts";
@import "utils/mixins/_mx-fonts";

@import "global/base";
@import "global/font-face";
@import "global/modifiers";
@import "global/get-media";

@import "regions/_r-footer-bottom";
@import "regions/_r-footer-top";

@import "components/_c-accordion";
@import "components/_c-cta";
@import "components/_c-text-image";
@import "components/form/_select";

@import "panels/_p-segment";
@import "panels/_p-zone";

@import "blocks/_b-footer-metalinks";
@import "blocks/_b-footer-nav";

@import "global/print";

Options

sassRoot

Type: string

Default value: scss

Define a string value which represents the path to your Sass/SCSS files.

Example: src/sass

source

Type: string

Default value: styles.scss

Define a string value which is the filename of your source file. In this file you have your glob patterns.

Example: _all.scss

output

Type: string

Default value: styles.tmp.scss

Define a string value which is the filename of your output file.

Example: styles-final.scss

hint

Type: string

Default value: // This file is generated by sass-globber.\n// Do not edit this file manually! ...

Define a string value which will be prepend to your output file.

Example: // This file is generated. \n

watch

Type: boolean

Default value: false

SassGlobbler has a build-in watcher which you can use. Under the hood I use chokidar to watch the files in sassRoot.

Example: true

Grunt Plugin

There is also a grunt module available: see grunt-sass-globber

License

Copyright (c) 2015 Sebastian Fitzner. Licensed under the MIT license.